En Tue, 27 Oct 2009 23:04:47 -0300, Steven D'Aprano
<ste...@remove.this.cybersource.com.au> escribió:
On Tue, 27 Oct 2009 21:48:36 -0300, Gabriel Genellina wrote:
En Tue, 27 Oct 2009 10:55:09 -0300, TerryP <bigboss1...@gmail.com>
escribió:
On Oct 26, 10:00 am, Anthra Norell <anthra.nor...@bluewin.ch> wrote:
How can one copy files on the OS level?
from ctypes import windll
CopyFile = windll.kernel32.CopyFileA
CopyFile("d:\\temp\\old.txt", "d:\\temp\\new.txt", True)
Have I missed something? What's wrong with shutil?
There's nothing wrong with shutil, but CopyFile and friends have some
additional features (correct handling of alternate data streams, progress
callback, reduced disk fragmentation...) that some people may be
interested in.
The idea was just to show how to call CopyFile using ctypes, not implying
that it's the only way to do that. Everyone knows that the One and True
Way of copying files is using PIP.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list