develooper Front page | perl.perl5.porters | Postings from May 2016

TONYC TPF Grant 7 report 7

Thread Next
From:
Tony Cook
Date:
May 27, 2016 01:10
Subject:
TONYC TPF Grant 7 report 7
Message ID:
20160527011009.GF2618@mars.tony.develop-help.com
[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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About