Re: open problem

Aaron M. Ucko (amu@mit.edu)
17 Jan 1998 11:55:36 -0500


Jason Watts <khg@m-net.arbornet.org> writes:

> If a dir is nothing but a file with dir entries, with its own
> inode etc., why wasn't an open system call implemented for directories?

It is. Most Linux file systems fail with EISDIR if you try to read(2)
from a directory; you should use readdir(3) or getdents(2) instead,
rather than concerning yourself with the physical layout for whatever
file system type you're using.

-- 
Aaron M. Ucko <amu@mit.edu> (finger amu@monk.mit.edu) [Stark raving sane]