get the file directory
Chris Torek
chris at mimsy.umd.edu
Mon Nov 20 03:43:30 AEST 1989
>In article <1724 at unccvax.UUCP> cs00wsc at unccvax.UUCP (Shiang Chin) writes:
>>... I don't know what's wrong on my code.
(Well, for one thing, it is in the wrong newsgroup: it is a Unix-specific
question. Merely because the directory reading is written in C does not
make directory-reading a C operation, and questions about reading Unix
directories belong in a Unix newsgroup---just as questions about reading
MS-DOS directories belong in an MS-DOS newsgroup.)
In article <11602 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>The main thing wrong is that you're attempting to read a directory
>as though it were an ordinary data file. These days, that's a poor
>assumption, and you should always use the portable <dirent.h>
>interface to read directories.
Actually, the directory still *is* (almost) an ordinary data file; but
it is a data file with a complex format, not a simple collection of
fixed-length records. Once you Reach Out over NFS (or are we allowed
to use the words `Reach Out' with NFS, that being a Sun system? :-) ),
however, directories are indeed not anything at all like ordinary data
files.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at cs.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list