write a file "copy" program in Python for Unix and Windows...

Andrew Bennetts andrew-pythonlist at puzzling.org
Sun Sep 28 22:09:08 EDT 2003


On Mon, Sep 29, 2003 at 01:59:52AM +0000, Ben Kial wrote:
> I need to write a program to "copy" files and preserved the files'
> atime, mtime, ctime, file permissions. I also need to have this
> program working in Unix and Windows, where the "Archive"
> attribute on the file also has to be preserved (any more
> Windows idiosyncrasies?).
> 
> Any help will be very much appreciated. Thanks in advance.

Try shutil.copy2 (and/or other functions in the shutil module).

-Andrew.






More information about the Python-list mailing list