Ask a Question related to PERL Beginners, Design and Development.
-
Larry Guest #1
File::Copy
Anyone know how to get File::Copy module to keep file permissions when
it copies from one location to another?
Thanks
Larry Guest Guest
-
i m using asp to copy a file but its not copied
hi i m using scripting.filesystemobject to copy a file from server directory with another name, but i m not able to do it whenever i call that... -
copy file
Hello all I like to move a uploaded file but I get the warning I do not have the right priviliges I tried to change this with the ftp_site... -
copy only the pm file?
Can i say that is an installation For example, i didn;t have the Tk::Columns so i download the pm file(source) and copied into the... -
File::Copy & CGI.pm
From: "Yupapa.com" <webmaster@yupapa.com> This aint entirely true. You can use File::Copy to copy files to remote shares (Windows Networking),... -
File copy
How can I copy a file from disk to server? Give me an example -
Wiggins D'Anconia #2
Re: File::Copy
Larry Guest wrote:
> Anyone know how to get File::Copy module to keep file permissions when
> it copies from one location to another?
>
> Thanks
>
>
"File::Copy also provides the "syscopy" routine, which copies the file
specified in the first parameter to the file specified in the second
parameter, preserving OS-specific attributes and file structure. For
Unix systems, this is equivalent to the simple "copy" routine, which
doesn’t preserve OS-specific attributes."
I suspect that means it can't... but wrapping it in your own routine
using 'stat' and 'chmod' to reset the permissions should be sufficient.
perldoc -f stat
perldoc -f chmod
Be sure to catch the part in the stat page about masking off the
filetype....
[url]http://danconia.org[/url]
Wiggins D'Anconia Guest
-
Tim Johnson #3
RE: File::Copy
Of course if it is using a system copy and you are using
NT/2000/XP/2003, then standard rules apply, i.e. copying from one device
to another won't necessarily copy the permissions, etc.
-----Original Message-----
From: Wagner, David --- Senior Programmer Analyst --- WGO
[mailto:David.Wagner@freight.fedex.com]
Sent: Tuesday, January 20, 2004 4:46 PM
To: [email]larry@opsource.net[/email]; [email]beginners@perl.org[/email]
Subject: RE: File::Copy
------------->SNIP<------------------
So if you are on any of the three systems above andyou are NOT
doing file handles, then the files should have the same file
permissions. If you are on something else, then someone on the list may
have what you need.
Wags ;)
Tim Johnson Guest
-
Jeff 'Japhy' Pinyan #4
Re: File::Copy
On Jan 21, zentara said:
Why do you backslash the . in "$ARGV[0]\.bak" but not in "completed.\n"?>copy( "$ARGV[0]", "$ARGV[0]\.bak" );
>chmod ($mode, "$ARGV[0]\.bak");
>print "Backup completed.\n";
Long story short, you don't need to \ the . in either case, and you don't
need quotes around $ARGV[0] as the first argument to copy().
copy($ARGV[0] => "$ARGV[0].bak");
--
Jeff "japhy" Pinyan [email]japhy@pobox.com[/email] [url]http://www.pobox.com/~japhy/[/url]
RPI Acacia brother #734 [url]http://www.perlmonks.org/[/url] [url]http://www.cpan.org/[/url]
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]
Jeff 'Japhy' Pinyan Guest



Reply With Quote

