From fe937a9fe468d3821699cc22af3e9cdcadf2608a Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Thu, 23 Mar 2023 15:13:33 +0100 Subject: [doc] clarify behavior of File::Copy::cp re: permissions In particular, explain that "preserve permission bits like cp" means the default behavior of /bin/cp, not "cp -p" or "cp --preserve", so the umask still applies. --- lib/File/Copy.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index 39bc23656b..1dc1d2d95c 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -23,7 +23,7 @@ sub syscopy; sub cp; sub mv; -$VERSION = '2.40'; +$VERSION = '2.41'; require Exporter; @ISA = qw(Exporter); @@ -395,9 +395,12 @@ You may use the syntax C to get at the C alias for this function. The syntax is I the same. The behavior is nearly the same as well: as of version 2.15, C will preserve the source file's permission bits like the shell utility -C would do, while C uses the default permissions for the -target file (which may depend on the process' C, file -ownership, inherited ACLs, etc.). If an error occurs in setting +C would do with default options, while C uses the default +permissions for the target file (which may depend on the process' +C, file ownership, inherited ACLs, etc.). That is, if the +destination file already exists, C will leave its permissions +unchanged; otherwise the permissions are taken from the source file +and modified by the C. If an error occurs in setting permissions, C will return 0, regardless of whether the file was successfully copied. -- cgit v1.2.1