How to copy file with preserving the file attributes

How to copy file with preserving the file attributes

am 26.05.2008 11:47:10 von yamagk3

Hi, How do you copy a file with preserving the file attributes, like "cp -p"?
Seems that File::Copy does not support. I'd like to do it on the Windows
environment.

Thanks!
Kenji.
--
View this message in context: http://www.nabble.com/How-to-copy-file-with-preserving-the-f ile-attributes-tp17468851p17468851.html
Sent from the mod_perl - General mailing list archive at Nabble.com.

Re: How to copy file with preserving the file attributes

am 26.05.2008 12:07:36 von aw

yamagk3 wrote:
> Hi, How do you copy a file with preserving the file attributes, like "cp -p"?
> Seems that File::Copy does not support. I'd like to do it on the Windows
> environment.
>

Hi.
That does not really sound like a mod_perl issue, more like a general
perl or perl-per-platform one.
Anyway, you might want to have a look at the various Win32:: modules, in
particular Win32::File.

A word of caution : if you are copying files where the source and/or
destination might be located on "network shares", you may need to be
extra careful in checking the result of your copying. The errors you
get sometimes do not necessarily reflect perfectly the real situation.
If you are "moving" a file for instance, you may want to explicitly
re-check if the target is really there and identical, before erasing the
source.

aw