* no need for cd
@ 1995-03-08 21:27 serge
0 siblings, 0 replies; 6+ messages in thread
From: serge @ 1995-03-08 21:27 UTC (permalink / raw)
Just for fun (:-), given that
+ current working directory is a (per-)process (file system)
specific information
and
+ Plan9/Brazil/VSTa/(Mach?) have a general mechanism for manipulating
this (i.e. mount)
then
+ it may be possible to eliminate/emulate cd/pwd via mount, e.g.
+ reserve (by convention only, of course :-) a
directory, say "/@" (a fat ".", ala sam :-), or
possibly something else, easier to type, e.g. without
the need for a shift key, say ",")
+ in libc/kernel: chdir(char *dir) { mount(dir, "/@"); }
+ in rc/sh/bin: fn pwd { mount | grep /@ | awk ... }
+ make the kernel prepend the string "/@" if the file
name does not begin with "/" and resolve the pathname again
It may also be possible to eliminate "." and "..", but only if they are
the first (and only, e.g. no "./." or "../..") thing at the front of a
pathname, since then they refer to process specific state (anywhere
else in a pathname they refer to a directory specific state):
+ reserve (by convention again :-) a directory, say /@@
(see above :-)
+ in libc/kernel: chdir(char *dir) {
mount(dir, "/@");
mount(basename(dir), "/@@"); }
+ make the kernel translate leading "./" and "../" to
"/@/" and "/@@/ (for compatibility only, e.g. new
programs don't need that and can use "/@" and "/@@"
directly)
Come to think of it, if the kernel just threw out (ala sed) all
occurrences of "./" and "xxx/../" in pathnames, we wouldn't even need
the above. (Didn't the Plan9 people say that mount entries are hashed,
so that ".." can refer to arbitrary directories, depending on what
you've mounted? E.g. this won't change any semantics.) We might even
be able call use "/." instead of "/@" and "/.." instead of "/@@".
(It's been too quiet here lately :-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* no need for cd
@ 1995-03-09 0:09 Scott
0 siblings, 0 replies; 6+ messages in thread
From: Scott @ 1995-03-09 0:09 UTC (permalink / raw)
serge writes:
| (Didn't the Plan9 people say that mount entries are hashed,
| so that ".." can refer to arbitrary directories, depending on what
| you've mounted? E.g. this won't change any semantics.)
Yes, they did. I find the idea of ".." in a union mount directory
confusing. It certainly breaks e.g. tar. A nice file tree walk
library could at least encapsulate strategies for avoiding lossage,
but if your filesystem is not a tree, is having ubiquitous ".."
entries the right thing? Maybe "set default prefix" is a better
abstraction. [My plan 9 manpages are stored in an old VMS binder;
there must be leakage.:-)]
^ permalink raw reply [flat|nested] 6+ messages in thread
* no need for cd
@ 1995-03-09 4:49 rob
0 siblings, 0 replies; 6+ messages in thread
From: rob @ 1995-03-09 4:49 UTC (permalink / raw)
a comment on your message: there is no word 'prepend'; use 'prefix'.
^ permalink raw reply [flat|nested] 6+ messages in thread
* no need for cd
@ 1995-03-09 7:30 David
0 siblings, 0 replies; 6+ messages in thread
From: David @ 1995-03-09 7:30 UTC (permalink / raw)
>a comment on your message: there is no word 'prepend'; use 'prefix'.
But it's in the Jargon File! :-) :-) :-)
:prepend: /pree`pend'/ [by analogy with `append'] vt. To
prefix. As with `append' (but not `prefix' or `suffix' as a
verb), the direct object is always the thing being added and not
the original word (or character string, or whatever). "If you
prepend a semicolon to the line, the translation routine will pass
it through unaltered."
^ permalink raw reply [flat|nested] 6+ messages in thread
* no need for cd
@ 1995-03-09 8:18 David
0 siblings, 0 replies; 6+ messages in thread
From: David @ 1995-03-09 8:18 UTC (permalink / raw)
> >a comment on your message: there is no word 'prepend'; use 'prefix'.
>
> But it's in the Jargon File! :-) :-) :-)
Which fact, I suspect, proves Mr. Pike's point admirably.
Dave.
^ permalink raw reply [flat|nested] 6+ messages in thread
* no need for cd
@ 1995-03-11 1:06 serge
0 siblings, 0 replies; 6+ messages in thread
From: serge @ 1995-03-11 1:06 UTC (permalink / raw)
rob@plan9.research.att.com:
> a comment on your message: there is no word 'prepend'; use 'prefix'.
Gee, does that mean you agree with everything else and will implement it
in Plan9/Brazil? :-) :-) :-)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1995-03-11 1:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-08 21:27 no need for cd serge
1995-03-09 0:09 Scott
1995-03-09 4:49 rob
1995-03-09 7:30 David
1995-03-09 8:18 David
1995-03-11 1:06 serge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).