[Jslib] Include Paths and File Execution

Pete Collins pete at mozdevgroup.com
Wed May 30 07:05:18 PDT 2007


>
>Now for a different question - is there a way to execute an external file? 
>As in run it, rather than open it for reading/writing?
>
>
>  
>

Sure:

fileutils "run()"

  http://jslib.mozdev.org/libraries/io/fileutils.js.html

Or if the OS supports it, you can use nsILocalFile.launch();

  http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsILocalFile.idl#156

var f = new File("/tmp/fubar.exe");

f.nsIFile.launch();

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