[Jslib] Opening files in Windows
pete at mozdevgroup.com
Mon Aug 2 10:55:02 EDT 2004
> What is the path I pass to File constructor? I tried
> var f = new File('file:///C|/foo/bar.txt');
var f = new File("c:\\foo\\bar.txt");
you are trying to escape the "f" and "b" in "c:\foo\bar.txt" string.
For *easily* getting various directories on the system, just use jsLib
So for example, you could do something like this:
var f = new File(getMozUserHomeDir());
On windows XP this would translate to somthing like:
c:\Documents and Settings\winXPUser\Application Data\
Pete Collins - Founder, Mozdev Group Inc.
Mozilla Software Development Solutions
More information about the Jslib