Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Recycle Bin and Python

Reply
Thread Tools

Recycle Bin and Python

 
 
Michael Foord
Guest
Posts: n/a
 
      10-15-2004
How do I move files into the windoze recycle bin from python ?

Regards,

Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html
 
Reply With Quote
 
 
 
 
Peter Maas
Guest
Posts: n/a
 
      10-15-2004
Michael Foord schrieb:
> How do I move files into the windoze recycle bin from python ?


By moving them into the recycle directory?

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
 
Reply With Quote
 
 
 
 
Dave Brueck
Guest
Posts: n/a
 
      10-15-2004
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
 
Reply With Quote
 
Michael Foord
Guest
Posts: n/a
 
      10-15-2004
Dave Brueck <> wrote in message news:<mailman.5002.1097843330.5135.python->...
> 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/atlantib...thonutils.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
#!/usr/bin/env python vs. #!/usr/bin/python Yves Dorfsman Python 27 05-10-2008 03:03 AM
Move files/directories to Recycle Bin using standard Python libs Kevin D. Smith Python 7 08-16-2007 12:37 AM
#!/usr/bin/python or #!/usr/bin/env python? John Salerno Python 30 08-10-2006 05:20 AM
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
Where do i find the recycle bin? XP PRO with norton protected bin Quiz Time Computer Support 6 06-27-2004 11:13 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57