Mateusz said:
deleting in windows explorer works fine in the same account
Yes, it is true. However, if you run your script and forget to close the
file, the unlink/delete/rm fails!
In Windows Explorer deleting always succeeds because your script is --
probably -- not active. (So, all of your files are closed by Ruby
engine, even if you doesn't closed them explicite.)
You cannot delete a file that is already open. You have to close it
before deletion.
WRONG:
f = File.open('jadzia','w+')
File.unlink('jadzia') =====> ERROR
RIGHT:
f = File.open('jadzia','w+')
f.close
File.unlink('jadzia') =====> OK!