[comp.sys.amiga] Directory and file naimg on the Amiga

cc1@valhalla.cs.ucla.edu (Michael Gersten) (09/09/88)

In article <4660@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) writes:
>In article <10580@stb.UUCP> michael@stb.UUCP (Michael) writes:
>>A colon followed by a slash may be an error (is it assigned to a subdir?)
>
>	It is an error.

Wrong. C:/bin is well defined, and I use it to find my bin directory before
I do an assign bin: 
Its only an error if assigned to a root directory (as I said, is it a subdir?)

>>N+1 non-initial consecutive slashes refers to N parents
>>N initial slashes refers to N parents
>
>	It's all a matter of how of how you tokenize (in your mind or
>otherwise) the pathname.  If you (in your mind) include the / at the end
>of a directory name, it makes sense.  Think of walking through the path
>left to right, handling it as you go.

Who said anything about tokenizing? I'm talking about: Given a string.
Analize that string. Note that one symbol is reserved (the '/'), and that
it has two different meanings, which are context sensitive. Besides, you 
can say "cd foo", without having to say "cd foo/". Anyways, I made a
mistake earlier. "C:/bin" has a non-initial slash that refers to a parent
directory (so there are two reserved characters, one of which can modify
the behavior of the other).

>
>>There is no easy way to take the name of a directory and append a file
>>	name to it.
>
>	Define easy.

Ok. I will define easy. Once again, give me a routine that I can use to
take a directory name (which may or may not end in a slash or a colon),
and a file name (which may include path information, or an absolute
assign name, or may just be a plain file name), and combine it to form
a single file name which I can use from anywhere.

Restrictions:
	A) You cannot get a lock on the file and work backwords. The file
	   may not yet exist. Or someone else may have it locked.
	B) You cannot assume that the file exists at present or that it
	   will be wanted in the future
	C) If the current directory lock is 0, then resonable assumptions
	   may be made (i.e., dir="", file="c" can become "df0:c" or "sys:c")

As I said, in unix this is simple. Your previous reply had a routine which
was just "Put the file at the end of the dir name", which only worked for
files in the current directory.
			Michael