Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uunet!math.fu-berlin.de!unido!mikros!mwtech!martin From: martin@mwtech.UUCP (Martin Weitzel) Newsgroups: comp.unix.questions Subject: Re: Number of files in a directory? Message-ID: <1146@mwtech.UUCP> Date: 23 May 91 22:14:52 GMT References: <1991May19.034308.9149@cpsc.ucalgary.ca> <1991May19.111727.18637@virtech.uucp> Reply-To: martin@mwtech.UUCP (Martin Weitzel) Organization: MIKROS Systemware, Darmstadt/W-Germany Lines: 15 In article <1991May19.111727.18637@virtech.uucp> cpcahil@virtech.uucp (Conor P. Cahill) writes: :mikeh@fsd.cpsc.ucalgary.ca (Michael Hoffos) writes: :>[...] :>how can you get the number of :>files that are in a directory? [...] :If on a v7 style filesystem you can get the size of the directory and :divide it by 16, but that only works on a single directory, is non-portable :and definately doesn't work for BSD style file systems. And it will not work if you have deleted some files from the directory, as directories don't shrink once they have been big (except you have a special utility to compress them). -- Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83