FAQ
[Hours] [Activity]
2016/05/02 Monday
  2.30 #127663 work on path handling, temp file creation,
                 handling
  1.23 #127663 re-work path storage
  1.07 #127834 (sec) review discussion, comment
=====
  4.60

2016/05/03 Tuesday
  0.17 #128056 look for and note a probable duplicate
  1.47 #127380 (sec) adjust one proposed patch, testing, comment
  0.50 list catch-up
  0.73 #127663 new approach
=====
  2.87

2016/05/04 Wednesday
  2.03 #127663 more work
  2.08 #127663 testing, debugging
=====
  4.11

2016/05/05 Thursday
  1.60 #127663 more close handling, polish, test suite failures
  3.70 #127663 work on nesting, testing, polish
=====
  5.30

Which I calculate is 16.88 hours.

Approximately 5 tickets were reviewed or worked on.

I've spent a fair amount of time working on [perl #127663].

This is an issue with in-place editing where if there's an error
writing the output, the content of input file is lost.

This occurs because when you do an in-place edit without requesting
backups, perl does:

   - open the input file
   - open an output handle to the same file, requesting replacement

so the entry for the input file in the directory is replaced
immediately, with the only reference remaining being the open input
handle.

I've been working on re-implementing this so that the output goes to a
work file and only once that work file has been closed successfully is
the original file either replaced, or renamed to the backup name.

This complicated by systems that don't supply rename() [1], systems
that don't support renaming open files, nested in-place editing [2]
and the possibility of user code changing directory in the middle of
processing a file.

[1] though we don't appear to have tested on such a platform recently,
one test fails

[2] see t/io/nargv.t

Search Discussions

  • Sawyer X at May 29, 2016 at 6:16 pm

    On 05/27/2016 03:10 AM, Tony Cook wrote:
    [Hours] [Activity]
    2016/05/02 Monday
    2.30 #127663 work on path handling, temp file creation,
    handling
    1.23 #127663 re-work path storage
    1.07 #127834 (sec) review discussion, comment
    =====
    4.60

    2016/05/03 Tuesday
    0.17 #128056 look for and note a probable duplicate
    1.47 #127380 (sec) adjust one proposed patch, testing, comment
    0.50 list catch-up
    0.73 #127663 new approach
    =====
    2.87

    2016/05/04 Wednesday
    2.03 #127663 more work
    2.08 #127663 testing, debugging
    =====
    4.11

    2016/05/05 Thursday
    1.60 #127663 more close handling, polish, test suite failures
    3.70 #127663 work on nesting, testing, polish
    =====
    5.30

    Which I calculate is 16.88 hours.

    Approximately 5 tickets were reviewed or worked on.

    I've spent a fair amount of time working on [perl #127663].

    This is an issue with in-place editing where if there's an error
    writing the output, the content of input file is lost.

    This occurs because when you do an in-place edit without requesting
    backups, perl does:

    - open the input file
    - open an output handle to the same file, requesting replacement

    so the entry for the input file in the directory is replaced
    immediately, with the only reference remaining being the open input
    handle.

    I've been working on re-implementing this so that the output goes to a
    work file and only once that work file has been closed successfully is
    the original file either replaced, or renamed to the backup name.

    This complicated by systems that don't supply rename() [1], systems
    that don't support renaming open files, nested in-place editing [2]
    and the possibility of user code changing directory in the middle of
    processing a file.
    Tony, thank you for sharing the details of the work you're doing. It's
    very interesting!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 27, '16 at 1:10a
activeMay 29, '16 at 6:16p
posts2
users2
websiteperl.org

2 users in discussion

Sawyer X: 1 post Tony Cook: 1 post

People

Translate

site design / logo © 2018 Grokbase