Sujet : Re: encapsulating directory operations
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 31. May 2025, 22:42:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <101ft3d$1feqh$2@dont-email.me>
References : 1 2 3
User-Agent : Pan/0.162 (Pokrosvk)
On Sat, 31 May 2025 08:20:33 +0200, Bonita Montero wrote:
Am 20.05.2025 um 09:27 schrieb Lawrence D'Oliveiro:
>
On Tue, 20 May 2025 16:06:19 +1000, Paul Edwards wrote:
And in essence, when you read from a directory, the only thing you get
is the filename.
You want at least the type of entry as well, surely.
<https://manpages.debian.org/readdir(3)>
Easier to handle:
https://en.cppreference.com/w/cpp/filesystem/directory_iterator.html
If you’re wanting language-specific facilities, then see if you can beat
this <
https://docs.python.org/3/library/os.html#os.walk>.
For one thing, notice how it gives you the choice of whether to follow
symlinks or not?
Oh, and also notice os.fwalk(), which supports dirfds.