Re: [xul-interop] How to Remove file ?
"Christophe Charron" <[email protected]> Sat, 21 Apr 2007 08:43:15 +0200
| Newsgroups | gmane.comp.lang.xul.general |
|---|---|
| Message-ID | <[email protected]> |
--===============0689080715== Content-Type: multipart/alternative; boundary="----=_Part_156193_12906932.1177137795303" ------=_Part_156193_12906932.1177137795303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, are you in chrome or in remote app ? 2007/4/19, salah <[email protected]>: > > > > Christophe Charron-2 wrote: > > > > Hi, > > > > 2007/4/18, salah <[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> > > > > > > What happens ? Any exception caught ? Are you sure having rigths ? Can > you > > open it ? > > > > > > ___ > > -- > > Cordially > > Christophe Charron > > > > > 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 > -- > View this message in context: > http://www.nabble.com/How-to-Remove-file---tf3601735.html#a10079647 > 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 > _______________________________________________ > xul-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/xul-talk > -- Cordialement Christophe Charron ------=_Part_156193_12906932.1177137795303 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi,<br>are you in chrome or in remote app ?<br><br><div><span class="gmail_quote">2007/4/19, salah <<a href="mailto:[email protected]">[email protected]</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <br><br>Christophe Charron-2 wrote:<br>><br>> Hi,<br>><br>> 2007/4/18, salah <<a href="mailto:[email protected]">[email protected]</a>>:<br>>><br>>><br>>> Hi everyone , :)<br>>> I try removing /home/user/file.txt file using code bellow but it doesn't <br>>> work can any one help me<br>>><br>>> ______________________________________________________________________<br>>> <?xml version="1.0" encoding="ISO-8859-1"?><br>>> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <br>>> <window<br>>> id="findfile-window"<br>>><br>>> xmlns="<a href="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul </a>"><br>>> <script><br>>> function delFile() {<br>>> var aFile =<br>>> Components.classes["@<a href="http://mozilla.org/file/local;1">mozilla.org/file/local;1 </a>"].createInstance();<br>>> if ( aFile instanceof Components.interfaces.nsILocalFile) {<br>>> aFile.initWithPath("/home/user/file.txt");<br>>> aFile.remove(false);<br>>> }<br>>> }<br>>> </script><br>>> <button label="Button 1" oncommand="delFile();"/><br>>> </window><br> ><br>><br>> What happens ? Any exception caught ? Are you sure having rigths ? Can you<br>> open it ?<br>><br>><br>> ___<br>> --<br>> Cordially<br>> Christophe Charron<br>><br>><br>I modify code to catch exception : <br>.........................<br><script><br> function delFile() {<br> try {<br> var aFile =<br>Components.classes["@<a href="http://mozilla.org/file/local;1">mozilla.org/file/local;1 </a>"].createInstance();<br> if ( aFile instanceof Components.interfaces.nsILocalFile ) {<br> aFile.initWithPath("/home/user/file.txt");<br> aFile.remove(false);<br> }<br> }catch ( e) { alert (e) ; }<br> }<br> </script><br>.........................<br>- message obtained is : Permission denied to get property<br>UnnamedClass.classes<br>- file.txt 's rights access are : 777 <br>- I can open file.txt<br>--<br>View this message in context: <a href="http://www.nabble.com/How-to-Remove-file---tf3601735.html#a10079647">http://www.nabble.com/How-to-Remove-file---tf3601735.html#a10079647</a><br>Sent from the XUL - User mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><br><br>-------------------------------------------------------------------------<br>This SF.net email is sponsored by DB2 Express<br>Download DB2 Express C - the FREE version of DB2 express and take <br>control of your XML. No limits. Just data. Click to get it now.<br><a href="http://sourceforge.net/powerbar/db2/">http://sourceforge.net/powerbar/db2/</a><br>_______________________________________________<br>XUL News Wire - <a href="http://xulnews.com">http://xulnews.com</a><br>XUL Job Postings - <a href="http://xuljobs.com">http://xuljobs.com</a><br>Open XUL Alliance - <a href="http://xulalliance.org">http://xulalliance.org</a><br>_______________________________________________ <br>xul-talk mailing list<br><a href="mailto:[email protected]">[email protected]</a><br><a href="https://lists.sourceforge.net/lists/listinfo/xul-talk">https://lists.sourceforge.net/lists/listinfo/xul-talk </a><br></blockquote></div><br><br clear="all"><br>-- <br>Cordialement<br>Christophe Charron ------=_Part_156193_12906932.1177137795303-- --===============0689080715== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --===============0689080715== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ XUL News Wire - http://xulnews.com XUL Job Postings - http://xuljobs.com Open XUL Alliance - http://xulalliance.org _______________________________________________ xul-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xul-talk --===============0689080715==--