Sujet : Re: encapsulating directory operations
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 21. May 2025, 01:18:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250520163755.523@kylheku.com>
References : 1 2 3 4 5 6
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-05-20, Paul Edwards <
mutazilah@gmail.com> wrote:
"Paul Edwards" <mutazilah@gmail.com> wrote in message
news:100j09o$2f04b$1@dont-email.me...
>
Manipulating directories is not as important as manipulating
files. The C90 people didn't leave out file manipulation (I
think the ISO Pascal people left it out, at least originally).
>
Actually, I think it was program paramaters that weren't
specified.
>
But again - maybe it is C90 that was wrong to specify argc
and argv and the Pascal people got it right.
>
That depends on the philosophy of language standards.
>
And I am not personally familiar with the philosophy of
language standards.
ANSI C was codifying a lot of existing practices.
C programs starting with a main() function which takes argc and argv was
in this category. It came from Unix, and C implementations on other
platforms imitated that.
C appeared as the systems programming language of Unix.
C on Unix had a way to process directories via library
functions.
Implementors of C on other systems choose to implement some functions
from Unix, and not others. They didn't implement the directory-related
ones, rendering them nonportable, and unsuitable for standardizing
into the language.
From my understanding, C and Unix standardization were separate but
somewhat coordinated efforts. Unix things that didn't get into C were
standardized by the emerging Unix standard.
Today, if I want a program tha tneeds to walk directories, I use the
POSIX C library. It is widely implemented. The program won't run
absolutely everywhere, but it will run on many embedded systems,
as well as supercomputers, and everything in between.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca