[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] `pwd` Bug or Feature?



At 2:51 AM +0100 3/18/97, Matthias Ulrich Neeracher wrote:
>Richard Rathe <rrathe@dean.med.ufl.edu> writes:
>>I use this line to get the current working directory:
>>
>>	$dir = `pwd`;
>>
>>There seems to be a difference if I'm working at the "root" level:
>>
>>	MacHD:		(root)
>>	MacHD:folder	(up one level)
>>
>>Notice that the former has a ":" on the end and the latter does not.
>>
>>Is this the way it should be? I'm using MacPerl 5.1.3r2.
>
>I don't know how it "should be", but it's not an accident that it's
>implemented
>this way :-)
>
>It is definitely necessary to have volume names terminate with a ":". It could
>be argued that it would be better to have all directory names end with ":", so
>the 2nd line would be the one to correct. However, I fear the consequences for
>existing code.

Apollo Domain/OS adds the concept of a "volume name" to Unix partitions;
usually it uses its own brand of volume sharing instead of nfs, and remote
directories show up with `pwd` as:

//machinename/home/foo

A pwd of the root becomes just:

//machinename

While I am not trying to claim that anything Apollo did is correct, this
might be a better way to handle naming drives than forcing a trailing
colon.  So,

::MacHD is the root level of a volume named "MacHD"
::MacHD:Documents:foo is an absolute path to a file (or a directory)
:Documents:foo is a relative path
Documents:foo
foo is a relative path

You could keep MacHD: as referring to the root level, for backward
compatibility, although on Unix that would also be a relative path.

---
Tom Holub (tom_holub@ls.berkeley.edu)
UC Berkeley, College of Letters & Sciences Computer Resources Team
(510) 642-9069