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/