> In working with the xp filepicker, I've run into the problem of having to find out
> whether a user typed in an absolute path or a relative path, and then call the right
> method (initWithPath / appendRelativePath) on nsILocalFile. This works "okay"
> because right now the xp filepicker is only used on linux/unix, but it's still ugly
> having to check if the typed in path starts with a "/" or not. This will become even
> uglier when you try to do this for other platforms like Windows, and imo doesn't
> belong here, but "behind the scenes" in the implementation of nsILocalFile.
>
> I might however be missing the obvious, so I'm wondering, is there already a method
> which allows me to get a nsILocalFile for an arbitrary path (as if I typed "more
> <path>", where path can be "/foo/bar" or "baz" on linux, "c:\foo\bar" or "baz" on
> Windows, etc.)?

So your requesting that we have a method that will take an arbitrary path.  If it is an
absolute path, this method will init the nsIFile with this new location and if it is a
relative path, it will just append.  Is this a correct understanding?


Reply via email to