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

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Thu, 1 Jul 1999 16:11:02 +0200


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.

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/