unix quirks (chmod 000 dir)

Richard Mathews lcc.rich-wiz at UCLA-LOCUS.ARPA
Tue Apr 23 08:33:29 AEST 1985


> Date: Fri, 12 Apr 85 08:25:12 pst
> From: Dan Heller <ucscc!argv at UCB-VAX.ARPA>
>
>     >>% mkdir foo
>     >>% chmod 000 foo
>     >>% cd foo
>     >>foo: no such file or directory
>     >>% WHAT?
>     >>no match.
>
> You don't seem to understand: it shouldn't say: "no such file or directory",
> it should say: "Permission denied."

Sorry, to rehash an old subject, but I'm a few weeks behind in my mail.
Looking through my backlog, however, I do not see the correct description
of the problem; so here goes.

I tried this on both our Locus Distributed System and on Caltech's 4.2 system.
If $cdpath is not defined, I get "Permission denied."  If I do have a cdpath,
I get "no such file or directory."  The problem is that Csh has tried to
do the "cd" relative to each directory in the cdpath and has failed each time.
It then reports the LAST error it encountered.

It seems to me that the best way to report errors in this case would be to
report the FIRST error which is not "no such file."  The "no such file"
message should appear only if EVERY call to chdir() resulted in ENOENT.

Richard M. Mathews
Locus Computing Corporation			       lcc!richard at ucla-cs
					{ucivax,trwrb}!lcc!richard
	 {ihnp4,randvax,sdcrdcf,ucbvax,trwspp}!ucla-cs!lcc!richard



More information about the Comp.unix.wizards mailing list