[Jslib] Error: File is not defined

roger roger at mondego.net
Tue Jun 8 12:12:01 EDT 2004



Pete Collins wrote:

> roger wrote:
>
>>
>> Hi when i try to open a local file that exists i get the following 
>> error:
>>
>> Error: File is not defined
>
>
>
>
>>
>> here is the code:
>>
>> function teste()
>> {
>>     
>> netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
>>
>>     include('chrome://jslib/content/io/file.js');
>>     var f=new File('/home/roger/teste.txt');
>>     var contentFrame = document.getElementById('mdg_moz_main');
>>     var texto="This is a test!\n";
>>     f.open('w');
>>     f.write(texto);
>>     f.close();
>> }
>>
>> if anyone can give me a tip about why this is not working or a way to 
>> dump the error msgs into the javascript console
>>
>> thank you in advance, 
>
>
>
>
> It is a privilege issue. What context are you running your test file in?
>
> It's obviously not a chrome file.
>
> Is it a local file you are accessing via file:// ?
>
> Or are you trying to do this on a remote html page? 

yes i'm trying in a remote application and  if i can't can you tell me why?
is it because mozilla don't give permissions or the jslib that doesn't 
allow?

>
>
> If the latter, you can't.
>
> --pete
>



More information about the Jslib mailing list