From: MAwiniarski Date: 2008-07-10T19:11:02+09:00 Subject: Re: How to delete a file in Win XP On Jul 10, 9:39 am, Luis Lavena wrote: > On Jul 10, 7:51 am, MAwiniarski wrote: > > > using: system('del ' + filename) > > > output is: .The process cannot access the file because it is being > > used by another process. > > > How to unlink file from all processes ?? > > Short answer: you can. > > Windows don't let you remove files that remain open or captured by > other process. There is also no easy way to access the unlocking API > to release those file handlers. > I'm trying to delete normal file which I CAN delete with windows explorer. And file is not opened by another application. It is simple 0 bytes file created earlier as a mock file for application development testing. > May I ask what are you trying to do? > > What you're expecting that ruby accomplish you can't accomplish even > using Windows Explorer, both will show the same error since this is > happening on a lower level in the OS. > > If you desperately need to release that file handler to remove the > file (dunno the reason, use at your own risk), look for Unlocker: > > http://ccollomb.free.fr/unlocker/ > > HTH, > -- > Luis Lavena