[Israel.pm] File permissions and File::Copy

Dovalle Yankelovich dovalle at smlink.com
Mon May 31 07:22:56 PDT 2004

I'm not sure on Linux but in windows you can "remember" the original
permissions and set the copied file accordingly


-----Original Message-----
From: Offer Kaye [mailto:oferk at oren.co.il] 
Sent: Monday, May 31, 2004 16:15
To: perl at perl.org.il
Subject: [Israel.pm] File permissions and File::Copy

Hi mongers,
I'm trying to use File::Copy's "copy" function to copy an executable
(permissions = 755 = "rwxr--r--"). OS is Linux, BTW.
The problem is that File::Copy does not preserve the executable
of the file. I think the problem is that the function opens the target
Perl's "open" function. The relevant code line (I think) from the
File/Copy.pm source:
   open($to_h,"> $to\0") or goto fail_open2;
(this is line number 130 in File::Copy version 2.05).
What can I do to make File::Copy preserve the file permissions when
Is this a bug or a feature? :-)

And no, I don't want to use the shell's copy...
Thanks in advance,
Offer Kaye

Perl mailing list
Perl at perl.org.il

More information about the Perl mailing list