Linux + create and write file

how create and write file on the Linux. code which i use in windows not work in Linux, thanks.

function writeFile( filename, content)
var file = Components.classes[“;1”].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath( filename );
var outputStream = Components.classes[“;1”].createInstance( Components.interfaces.nsIFileOutputStream );
outputStream.init( file, 0x04 | 0x08 | 0x20, 420, 0 );
var result = outputStream.write( content, content.length );

I would have the javascript make a remote call to a server side script via AJAX. To me, it seems a heck of a lot easier to do it that way.

Ok. I am toolbar developer, but i never work with ajax. may be you have some example for me or native links. Thanks.