directory handling in ansi C

Doug McDonald mcdonald at aries.uiuc.edu
Wed Nov 22 10:56:40 AEST 1989


In article <11659 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <13288 at s.ms.uky.edu> beech at 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



More information about the Comp.std.c mailing list