diff options
author | Tony Cook <tony@develop-help.com> | 2017-01-11 14:49:53 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2017-09-11 10:59:43 +1000 |
commit | e0d4aead3c87ba953fb1d70678a77a45e0c9f111 (patch) | |
tree | fdd504d77c4fb77b90344481b0921993eda33af4 /pod | |
parent | c683db79063638b79d9620ad4dcd5bd14552bc6b (diff) | |
download | perl-e0d4aead3c87ba953fb1d70678a77a45e0c9f111.tar.gz |
(perl #127663) safer in-place editing
Previously in-place editing opened the file then immediately
*replaced* the file, so if an error occurs while writing the output,
such as running out of space, the content of the original file is lost.
This changes in-place editing to write to a work file which is renamed
over the original only once the output file is successfully closed.
It also fixes an issue with setting setuid/setgid file modes for
recursive in-place editing.
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldiag.pod | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 7a7b220747..806c29f646 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1311,9 +1311,14 @@ the modified file. The file was left unmodified. =item Can't rename %s to %s: %s, skipping file -(S inplace) The rename done by the B<-i> switch failed for some reason, +(F) The rename done by the B<-i> switch failed for some reason, probably because you don't have write permission to the directory. +=item Can't rename in-place work file '%s' to '%s': %s + +(F) When closed implicitly, the temporary file for in-place editing +couldn't be renamed to the original filename. + =item Can't reopen input pipe (name: %s) in binary mode (P) An error peculiar to VMS. Perl thought stdin was a pipe, and tried @@ -2311,7 +2316,7 @@ Check the #! line, or manually feed your script into Perl yourself. CHECK, INIT, or END subroutine. Processing of the remainder of the queue of such routines has been prematurely ended. -=item Failed to close in-place edit file %s: %s +=item Failed to close in-place work file %s: %s (F) Closing an output file from in-place editing, as with the C<-i> command-line switch, failed. |