Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!uw-beaver!ssc-vax!uvicctr!tholm From: tholm@uvicctr.UUCP (Terrence W. Holm) Newsgroups: comp.os.minix Subject: Re: directory(3) Message-ID: <581@uvicctr.UUCP> Date: 19 Dec 88 21:37:38 GMT References: <575@uvicctr.UUCP> <7488@ea.ecn.purdue.edu> Reply-To: tholm@uvicctr.UUCP (Terrence W. Holm) Organization: University of Victoria, Victoria B.C. Canada Lines: 27 In article <7488@ea.ecn.purdue.edu> housel@en.ecn.purdue.edu (Peter S. Housel) writes: > > There is a problem with these routines as distributed here. OK, did Terrence not test this code well enough before posting? Or, was Peter so anxious to post, that he didn't install and test exactly what I posted? > ... (The comment in dirent.h says that DIRBUF should be >larger than the "filesystem buffer size," but it doesn't explain why.) It must be larger because directory entries are expanded to the system-independent format "struct dirent". For version 7, a 16 byte directory entry may be expanded to as much as 28 bytes, ie. almost twice as large. > Probably the best solution is to compile getdents.c with a >"-DDIRBLKSIZ=512" compiler flag. See /usr/include/sys/dir.h Terrence W. Holm uunet!uw-beaver!uvicctr!tholm tholm%uvunix.bitnet tholm@uvicctr.UVic.ca