Re: [Rest2web-develop] Use of tilde as HOME indicator in paths
Brought to you by:
mjfoord
From: Grzegorz A. H. <gr...@ti...> - 2006-12-06 19:55:39
|
On 2006-10-10, Michael Foord <fuz...@gm...> wrote: > I now do 'expanduser' (~) expansion for the paths in the config file and the > 'file' keyword in restindexes. > > Anywhere else ? In theory this should happen "everywhere", in a transparent way. What I mean about transparent is that if you let users write '~/something' in a configuration file, you can't write it back to disk as '/home/user/something', since that may be or not the same username on a different machine if I've copied that over the network to another machine/account, or just happen to work on Linux and Macs, where the paths are different. Internally that's a pain, since you basically need to maintain the enduser version and always expand it before using the filename. Sort of the same goes for symlinks, where you can't go up the tree with "cd .." because you may not end up in the place you expected. I've always been tempted to use a special filename class which would return the user specified string or the full real path name. This can be handy when you get two paths and try to find out if you can build a relative likn from one to the other. |