Path: utzoo!attcan!uunet!mailrus!iuvax!ux1.cso.uiuc.edu!aries!mcdonald From: mcdonald@aries.uiuc.edu (Doug McDonald) Newsgroups: comp.std.c Subject: Re: directory handling in ansi C Keywords: ansi c, directories Message-ID: <1989Nov21.235640.3662@ux1.cso.uiuc.edu> Date: 21 Nov 89 23:56:40 GMT References: <13288@s.ms.uky.edu> <11659@smoke.BRL.MIL> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: mcdonald@aries.scs.uiuc.edu (Doug McDonald) Organization: School of Chemical Sciences, Univ. of Illinois at Urbana-Champaign Lines: 40 In article <11659@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <13288@s.ms.uky.edu> beech@ms.uky.edu (Wayne Beech) writes: >>Does anyone know the rationale behind not specifically defining a set of >>functions to work with directories in ansi C; things like opendir(), ... > >What's a directory? Interesting question. Let's try another: what is a file? Assuming that MR. Gwyn, who is a member of X3J11, does not know what a directory is, we shall, since he is a member of the committee, and it has indeed included things called "files" in its hosted library, know what a "file" is. So does X3J3 (know what a file is). So, Mr. Gwyn, how, in C, do I open a file written by open(unit = 11, form="unformatted", access="sequential", 1 status = "new") x = 3.3 i = 17 write(11) x,i write(11) x,i and read it, in C, to recover the numbers 3.3, 17, 3.3, 17 in that order? Okay, seriously, C assumes that things called "files" are a lot simpler than they are in general. So a precedent is set: the promulgators of C are prepared to accept a subset of possible operations on "files". Why not do the same for directories? "No prior art" (in C of course) is an acceptable answer. I find it hard to believe that X3J11 can come up with any other explanation that isn't stupid, other than that or "we ran out of steam" or "it's already too big" or "we don't care about directories". The correct answer is likely all but the last. Doug McDonald