Tobias Klein wrote:
Hi all,

Is there any way to make the nslLocalFile Component working with
relative paths?

Actually I'm using the method initWithPath. But in this case relative
path descriptions don't seem to work. I'd like to run a
Mozilla-XUL-Application with autorun (CD-ROM). So I need some relative
path functionality.

Greez

Tobias Klein

initWithPath does not accept relative path. The path parameter is defined as:


     *       A string which specifies a full file path to a
     *       location.  Relative paths will be treated as an
     *       error (NS_ERROR_FILE_UNRECOGNIZED_PATH).

If you want to use relative paths, do as Benjamin suggested and ask the directory service for the application directory. Then you can use that result with methods such as appendRelativePath or append.

regards,
Doug Turner




Reply via email to