Copying files in Python

Discussion in 'Python' started by Russell Lear, Jul 3, 2003.

  1. Russell Lear

    Russell Lear Guest

    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.
     
    Russell Lear, Jul 3, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    508
  2. gtb
    Replies:
    7
    Views:
    402
  3. Lalit

    copying files through Python

    Lalit, Feb 13, 2008, in forum: Python
    Replies:
    8
    Views:
    508
    Tim Chase
    Feb 16, 2008
  4. Catherine Moroney

    fast copying of large files in python

    Catherine Moroney, Nov 2, 2011, in forum: Python
    Replies:
    1
    Views:
    912
    Dave Angel
    Nov 2, 2011
  5. Shawn Mcclain
    Replies:
    0
    Views:
    187
    Shawn Mcclain
    Sep 28, 2007
Loading...

Share This Page