Copying files in Python

R

Russell Lear

A simple question from a python beginner: How do I do 'cp -p source
destination' where source could be a list of files and destination could be
a file or directory (I could break the operation up if it must be file to
file)? Perserving file creation time is important. Platform independence
also nice.

Clearly I could open the source file for reading and a destination file for
writing and copy the bits over, but that might not preserve the file
creation time.

Right now I'm running Python 2.2.2 on SuSE Linux 8.2

I'll probably find the answer to this 30 minutes after posting this (isn't
that always the way?) but any help would be appreciated.

Thanks,
Russell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top