Re: If we cannot change file system semantics, we must concede that Bill Gates is right that Linux c

Hans Reiser (reiser@ceic.com)
Thu, 1 Jul 1999 16:30:09 +0000 (/etc/localtime)


You are right that /etc without the / is the one, I didn't intend the /.

Jamie Lokier writes:
> Hans Reiser wrote:
> > open("/etc/", O_RDONLY) then, I don't get your point.
>
> Be cautious. This form is used by many programs to get a _directory_
> handle for fchdir(). Only the O_RDONLY form.

Hmmm. Unfortunate. Don't know the answer immediately to this one.

>
> Very few programs know to use O_DIRECTORY. Glibc does for opendir(),
> but opendir() is not normally used to get handles for fchdir().
>
> The trailing slash is also used to force interpretation as a directory
> -- that's not portable to all systems, but has been the case on Linux
> for as long as I remember.
>
> If anything, only the version _without_ "/" should open as a file.
>
> -- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/