[xul-interop] How to Remove file ?

salah <[email protected]> Wed, 18 Apr 2007 09:13:20 -0700 (PDT)
Newsgroups gmane.comp.lang.xul.general
Message-ID <[email protected]>
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>
___________________________________________________________________________________
-- 
View this message in context: http://www.nabble.com/How-to-Remove-file---tf3601735.html#a10061119
Sent from the XUL - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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