summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorDan Collins <dcollinsn@gmail.com>2016-07-05 19:02:12 -0400
committerJames E Keenan <jkeenan@cpan.org>2017-06-01 09:54:57 -0400
commit5c3085ee8edac26825ef44056ea5aba97493d7ab (patch)
treee36c30b8b14ad1d3077efa81ec3aa73cd16248ea /pod
parent53dfb2b77ebf8ed9ec272b080bee192fb878051a (diff)
downloadperl-5c3085ee8edac26825ef44056ea5aba97493d7ab.tar.gz
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.
Diffstat (limited to 'pod')
-rw-r--r--pod/perlfunc.pod4
1 files 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";
}