How to Remove file ?

View: New views
5 Messages — Rating Filter:   Alert me  

How to Remove file ?

by salah :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 ?

by Christophe Charron-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

2007/4/18, salah <salah.triki@...>:

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 ?
 

___________________________________________________________________________________
--
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
_______________________________________________
xul-talk mailing list
xul-talk@...
https://lists.sourceforge.net/lists/listinfo/xul-talk

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

by salah :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christophe Charron-2 wrote:
Hi,

2007/4/18, salah :
>
>
> 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

Re: How to Remove file ?

by Christophe Charron-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
are you in chrome or in remote app ?

2007/4/19, salah <salah.triki@...>:


Christophe Charron-2 wrote:

>
> Hi,
>
> 2007/4/18, salah <salah.triki@...>:
>>
>>
>> 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
xul-talk@...
https://lists.sourceforge.net/lists/listinfo/xul-talk



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

by salah :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm in chrome

Christophe Charron-2 wrote:
Hi,
are you in chrome or in remote app ?

2007/4/19, salah <salah.triki@gmail.com>:
>
>
>
> Christophe Charron-2 wrote:
> >
> > Hi,
> >
> > 2007/4/18, salah <salah.triki@gmail.com>:
> >>
> >>
> >> 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
> xul-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xul-talk
>



--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xul-talk