Impossible to remove a file in Windows?
7 posts
• Page 1 of 1
Ok, I'm using Windows 2000.
var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance(); var aLocalFile = aFile.QueryInterface(Components.interfaces.nsILocalFile); fPath = "c:\\temp\\test.txt"; /* file exists. Before the following lines, I have created, opened, written, and read from it without a problem. */ aLocalFile.initWithPath(fPath); aLocalFile.remove(true); Why can't I delete the blasted thing? whether I use remove(true) or false, still get an error, and the file refuses to be deleted. Anyone have a solution for this? Thanks -D I don't know what your problem is, but sometimes when I use windows and I get the cannot delete file problem... and I can't figure it out, I reboot my machine and that usually works. it's not always about file locking. sometimes, it stays locked?? even after the app is closed.
OT: Agamid,
I have the same problem in W2K. Killing explorer.exe in Task Manager works. I think that the only files you can delete through XPCOM must be located in the chrome directory.
Even this, I'm not sure. For example in TBE, Piro's exUnregistere.js is unable to remove the TBE.jar file. For security reasons, obviously. Marc
what's OT? OT = off topic.
Because it had nothing to do with the original post. Another not confirmed idea:
Maybe you need a signed script to perform the delete operation. Anyway, if you find the solution, let us know. Marc
7 posts
• Page 1 of 1
Return to Extension Development Who is onlineUsers browsing this forum: No registered users and 1 guest |
![]() |