[Jslib] Antwort: Re: Executing unix command ( such as ls ) from the jslib

Pete Collins pete at mozdevgroup.com
Wed Apr 8 07:26:26 PDT 2009


>
> var file = new File("/home/pawan/text.txt").
>  It creates file named test.txt in home of user pawan....
>
> function createFile()
> {  
>   jslib.init(this);
>   include (jslib_file);
>   var file = new File("test.txt");
>   file.open("w");
>   file.write("This is a first file created by browser\n");
>   file.close();
> }
>
>   
The file.open("w");

Creates the file ...

> This program I am using to create file ...but it does not create file..I
> don't know y ...May be its creating the file from where firefox is
> invoked...
>
> But how to create file in my chrome://somename/content/
> I want to create file in this folder....
>
>   
You need permission to write to the chrome dir.

Also, in most cases "chrome://somename/content" is a mapped resource 
that points to a jar archive and is not a file on the filesystem.

Usually for files you want to create and write to, you would place them 
in the mozilla/firefox profile dir which is a place you have permission 
to write to.

--pete

-- 
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions
tel: 1-719-302-5811
fax: 1-719-302-5813



More information about the Jslib mailing list