Recycle Bin and Python

Michael Foord fuzzyman at gmail.com
Fri Oct 15 23:54:29 CEST 2004


Dave Brueck <dave at pythonapocrypha.com> wrote in message news:<mailman.5002.1097843330.5135.python-list at python.org>...
> Michael Foord wrote:
> > How do I move files into the windoze recycle bin from python ?
> 
> This is really a Windows API question first, and a Python question second.
> 
> 1) Find out the "official" way to do this in Windows
> 
> I googled for "msdn move file recycle bin" and the first link that came back was 
> a page on MSDN for SHFileOperation. In typical Windows fashion, it involves 
> populating some structure and passing it to the function, but it does appear to 
> do the trick.
> 
> 2) Figure out how to do this in Python.
> 
> You can create such a structure in ctypes, after which you can make the actual 
> call like this:
> 
> i = windll.shell32.SHFileOperationA(byref(yourStruct))
> 
> HTH,
> Dave


It does help.. yeeurgh....

But thanks.

Fuzzy

http://www.voidspace.org.uk/atlantibots/pythonutils.html



More information about the Python-list mailing list