In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5c3085ee8edac26825ef44056ea5aba97493d7ab?hp=53dfb2b77ebf8ed9ec272b080bee192fb878051a>
- Log ----------------------------------------------------------------- commit 5c3085ee8edac26825ef44056ea5aba97493d7ab Author: Dan Collins <dcolli...@gmail.com> Date: Tue Jul 5 19:02:12 2016 -0400 perlfunc.pod: explain seek in O_APPEND In all modern systems, seek has no effect in O_APPEND. As explained by Nick Cleaton at that RT, the comment was written in a time when: ...opening a file for append [was] the same as opening for write and then seeking to the end. This is not the case. When a file is opened in append mode, all writes are appended to the then end of file, irrespective of the current file position. Corrected comment was contributed by him. ----------------------------------------------------------------------- Summary of changes: pod/perlfunc.pod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index b8dca6e08f..1fb479d2e2 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2760,8 +2760,8 @@ Here's a mailbox appender for BSD systems. sub lock { my ($fh) = @_; flock($fh, LOCK_EX) or die "Cannot lock mailbox - $!\n"; - - # and, in case someone appended while we were waiting... + # and, in case we're running on a very old UNIX + # variant without the modern O_APPEND semantics... seek($fh, 0, SEEK_END) or die "Cannot seek - $!\n"; } -- Perl5 Master Repository