From: MAwiniarski Date: 2008-07-10T14:51:13+09:00 Subject: Re: How to delete a file in Win XP 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 ?? On 10 Lip, 00:39, "Pablo Q." wrote: > Another solution could be use a system call: > > `DEL #{file}` > or > system("DEL #{file}") > > it returns true or false. > > 2008/7/9 Luis Lavena : > > > > > On Jul 9, 8:12 pm, MAwiniarski wrote: > > > 1. I'm in a proper directory (using: puts Dir.entries(Dir.pwd) > > > 2. File do not need to be closed, because it haven't been open (it's > > > just file in a folder) > > > 3. Error message: > > >    Errno::EACCES: Permission denied - file > > > 4. I've used chmod in previous line: > > >    File.chmod(0644, file) > > >    chmod return flag: 1 (one) > > > 5. Using File.delete or File.unlink gives same error message > > > File.chmod has no effect on Windows. > > > Can you ensure that, from the command line, safely remove that file? > > Even if not you the one that openned the file, maybe other part of the > > OS are locking it so you can't perform the delete operation safely. > > > HTH, > > -- > > Luis Lavena > > -- > Pablo Q.