I have some profile mgr bugs which could all be solved if we had 
something (I think) we're missing: XP, relative file specs. If we had 
this, several nifty things could be done:
(1) On a dual boot system, use the same profile for both OSs.
(2) When you have several OSs that can share files over a network, like 
most of us, you could use the same profile on all your machines. Maybe 
not at the same time, but that's another problem :-/
(3) Changing the location of your home dir on Unix would not be a problem.
(4) If the name of your home dir is different between home and work but 
you'd like to take your profile dir to and fro and a ZIP drive.

All we need to do this is to have a file descriptor which is not an 
absolute path, but a relative path. The point to which it's relative 
would be any location defined by nsIDirectoryService. What we could do 
is to add methods to nsILocalFile:

void getRelativeDescriptor(in string fromLocation, out string desc);

Here, fromLocation is a key defined by directory service. What comes out 
in desc is a string with the key and then a UTF-8 encoded relative path. 
The relative path is made from the location returned by directory 
service for fromLocation. If a relative path can't be made (the file is 
on a different drive from fromLocation), it's an error. The desc can be 
stored in a registry, prefs, and so on.

void initWithRelativeDescriptor(in string desc);

Here, a file will take the desc string, decode it, and initialize itself 
with it. The way the relative path is written the same on all platforms, 
using whatever format we decide. The implementation of nsILocalFile on 
each platform will have to convert this generic relative path into a 
native relative path.

Sound useful? Any better ways to do this?

-Conrad


Reply via email to