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:
>>> The function "os.system
>>> ('copy file_name directory_name')" turns out doesn't do anything
>>> except flashing a DOS command window for half a second. So my question
>>> is: How can one copy files on the OS level?

[...]

> It's as simple as this:
> 
>    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? 

shutil.copyfile(source, destination) seems to work for me, even on 
Windows.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to