Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: encapsulating directory operations Date: Tue, 20 May 2025 02:18:54 -0700 Organization: None to speak of Lines: 31 Message-ID: <87ecwj1vy9.fsf@nosuchdomain.example.com> References: <100h650$23r5l$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Tue, 20 May 2025 11:18:56 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f0df7d044b5b3d3fe78271422eaadef6"; logging-data="2288284"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zVztvWUxIIBRgWZ+Cvsad" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:P2EHcFeauVtFuxL2f4GEABV5HIo= sha1:nJw9LI2Cba1K8gvcDcgeC2j4t+o= "Paul Edwards" writes: > Someone (Jean-Marc) wrote some "folder" routines which I like a lot. > You can see them here: > > https://sourceforge.net/p/pdos/gitcode/ci/master/tree/hwzip/folder.c > > And in essence, when you read from a directory, the only > thing you get is the filename. If it is actually a subdirectory, > then that is indicated with a "/" at the end of the filename. > > Other things like size and creation date are not available, > and C90 does not guarantee that such concepts even > exist. C90 does guarantee that files exist though. C90, like all later standards, supports file operations only in hosted implementations, not in freestanding implementations. Even on a conforming hosted implementation, every call to fopen() could fail. [...] > And C90 (etc) could potentially be extended to include a folder.h C90 will never be extended. It was made obsolete by C99, which was made obsolete by C11, which was made obsolete by C23. You're free to invent your own language based on C90 if you like, but C went in a different direction decades ago. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */