summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorDominic Hargreaves <dom@earth.li>2016-04-30 18:03:01 +0100
committerDominic Hargreaves <dom@earth.li>2016-04-30 18:03:23 +0100
commite52682c1b86499977ca540dd02f99bfef2531899 (patch)
tree4ab31fdef6e60b04fc72021d0cd36c062804bf8e /lib/File
parent5290b67bf5ccc187badf933627726c9977dd23db (diff)
downloadperl-e52682c1b86499977ca540dd02f99bfef2531899.tar.gz
File::Copy: add a warning about flushing writes
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494590
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Copy.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm
index 95fb4e18f3..0a6a81eeca 100644
--- a/lib/File/Copy.pm
+++ b/lib/File/Copy.pm
@@ -489,6 +489,14 @@ it sets C<$!>, deletes the output file, and returns 0.
All functions return 1 on success, 0 on failure.
$! will be set if an error was encountered.
+=head1 NOTES
+
+Before calling copy() or move() on a filehandle, the caller should
+close or flush() the file to avoid writes being lost. Note that this
+is the case even for move(), because it may actually copy the file,
+depending on the OS-specific inplementation, and the underlying
+filesystem(s).
+
=head1 AUTHOR
File::Copy was written by Aaron Sherman I<E<lt>ajs@ajs.comE<gt>> in 1995,