Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!ark1!nems!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: get the file directory Keywords: directory Message-ID: <20828@mimsy.umd.edu> Date: 19 Nov 89 16:43:30 GMT References: <1724@unccvax.UUCP> <11602@smoke.BRL.MIL> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 24 >In article <1724@unccvax.UUCP> cs00wsc@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@smoke.BRL.MIL> gwyn@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 >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@cs.umd.edu Path: uunet!mimsy!chris