Liste des Groupes | Revenir à cl c |
On 2025-05-20, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:[...]"Paul Edwards" <mutazilah@gmail.com> writes:
>As far as I know, there was never any LOGICAL barrier>
to including basic directory manipulation in C90.
None that I can think of.
There was a significant barrier. The ANSI group which standardized
C was mainly looking at surveying and codifying existing practice.
Sure, it would be theoretically possible to treat directories as files,>
and to make reading from a FILE* resulting from calling fopen() with a
directory name give you access to the directory entries.
I implemented something like this. It is fine; I don't regret it.
>
i1> (open-directory ".")
#<dir-stream b7b90820>
2> (get-line *1)
"htrailer.txr"
3> (get-line *1)
"y.output.bison"
4> (get-line *1)
"jmp.S"
5> (open-file "/etc/hosts")
#<file-stream /etc/hosts b7b7a8b0>
6> (get-line *5)
"127.0.0.1\tlocalhost"
7> (get-line *5)
"127.0.1.1\tsun-go"
Les messages affichés proviennent d'usenet.