Move files/directories to Recycle Bin using standard Python libs

Chris Mellon arkanes at gmail.com
Wed Aug 15 20:37:04 EDT 2007


On 8/15/07, kyosohma at gmail.com <kyosohma at gmail.com> wrote:
> On Aug 15, 2:55 pm, Kevin D. Smith <Kevin.Sm... at sas.com> wrote:
> > On 2007-08-15 13:02:24 -0600, "Chris Mellon" <arka... at gmail.com> said:
> >
> > > Not easily. The recycle bin is part of the shell, and the shell api
> > > calls have very complicated struct parameters that are cumbersome to
> > > use correctly from ctypes. If you do the work to map the fileop
> > > structs to ctypes you can call the shell API file operation functions
> > > in shell32.dll. This assumes that "standard" for you is Python 2.5,
> > > which has ctypes. Otherwise you are out of luck.
> >
> > Unfortunately, I need this to work on Python 2.4 as well...
> >
> > --
> > Kevin D. Smith
>
> As I mentioned in my previous post, you can download ctypes from
> sourceforge for 2.4.
>
> Mike
>

If you're going to install a third party lib, install pywin32 and do
it the easy way. OP said he wanted to it with standard library only.



More information about the Python-list mailing list