|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
How to Remove file ?Hi everyone , :)
I try removing /home/user/file.txt file using code bellow but it doesn't work can any one help me ______________________________________________________________________ <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function delFile() { var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance(); if ( aFile instanceof Components.interfaces.nsILocalFile) { aFile.initWithPath("/home/user/file.txt"); aFile.remove(false); } } </script> <button label="Button 1" oncommand="delFile();"/> </window> ___________________________________________________________________________________ |
|
|
Re: How to Remove file ?Hi,
2007/4/18, salah <salah.triki@...>:
What happens ? Any exception caught ? Are you sure having rigths ? Can you open it ? ___________________________________________________________________________________ -- Cordially Christophe Charron ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ XUL News Wire - http://xulnews.com XUL Job Postings - http://xuljobs.com Open XUL Alliance - http://xulalliance.org _______________________________________________ xul-talk mailing list xul-talk@... https://lists.sourceforge.net/lists/listinfo/xul-talk |
|
|
Re: How to Remove file ?I modify code to catch exception : ......................... <script> function delFile() { try { var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance(); if ( aFile instanceof Components.interfaces.nsILocalFile ) { aFile.initWithPath("/home/user/file.txt"); aFile.remove(false); } }catch ( e) { alert (e) ; } } </script> ......................... - message obtained is : Permission denied to get property UnnamedClass.classes - file.txt 's rights access are : 777 - I can open file.txt |
|
|
Re: How to Remove file ?Hi,
are you in chrome or in remote app ? 2007/4/19, salah <salah.triki@...>:
-- Cordialement Christophe Charron ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ XUL News Wire - http://xulnews.com XUL Job Postings - http://xuljobs.com Open XUL Alliance - http://xulalliance.org _______________________________________________ xul-talk mailing list xul-talk@... https://lists.sourceforge.net/lists/listinfo/xul-talk |
|
|
Re: How to Remove file ?I'm in chrome
|
| Free Forum Powered by Nabble | Forum Help |