Liste des Groupes | Revenir à cl c |
Bonita Montero <Bonita.Montero@gmail.com> writes:It results in much less code. Just like a lambda passedAm 06.06.2025 um 16:10 schrieb Scott Lurndal:That's a matter of opinion.Bonita Montero <Bonita.Montero@gmail.com> writes:>Am 03.06.2025 um 20:25 schrieb Scott Lurndal:>>>>The fchownat() function shall be equivalent to the chown() and lchown()>
functions except in the case where path specifies a relative path. In
this case the file to be changed is determined relative to the directory
associated with the file descriptor fd instead of the current working
directory. If the access mode of the open file description associated
with the file descriptor is not O_SEARCH, the function shall check
whether directory searches are permitted using the current permissions
of the directory underlying the file descriptor. If the access mode is
O_SEARCH, the function shall not perform the check.
And why is this relevant for directory_iterator or
recursive_directory_iterator ?
Why are you asking this question on comp.lang.c?
Because you can have it easier than with opendir() / readdir().
Personally, I'd use nftw to iterate over a path.
>
https://pubs.opengroup.org/onlinepubs/9799919799/functions/nftw.html
That would be much nicer with a lambda which can take the context
of the calling function.
>
In any case, nftw is a C function and C doesn't support lamda functions.Lambdas without capture can be converted to C function-pointers.
Les messages affichés proviennent d'usenet.