Sujet : Re: encapsulating directory operations
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 21. May 2025, 03:26:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <100jdlh$2kpbr$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
"Paul Edwards" <
mutazilah@gmail.com> writes:
...
When C90 was being written - or indeed - when K&R was
being written - if there hadn't been pressure to "bring to market",
would you EXPECT a language standard - any language
standard - but in this specific instance the ISO/IEC 9899:1990
committee - to have included a standard form of directory
manipulation.> As far as I know, there was never any LOGICAL barrier
to including basic directory manipulation in C90.
There is a practical barrier - while C was developed in the context of
Unix, which had a lot of influence on the design of C, that design has
also always been motivated by a desire to, among other things, be as
widely portable as possible. There is a wide variety of different ways
to organize memory, and not all of those ways map well to a Unix-like
directory structure. The most different structure that I'm personally
familiar with is VMS, where the closest equivalent to a Unix directory
was versioned. If you specify a directory with a version number, you get
that version of that directory (if it exists); if you don't specify a
version, by default you get the latest version.
I'm sure there are more obscure cases that I'm not familiar with, and at
the time when K&R was being written, the variety was even larger. By
leaving directory handling up to OS routines, they avoided having to
design the relevant C library functions so they could be implemented
efficiently on that wide variety of platforms.