Source for: https://cirosantilli.com and https://ourbigbook.com/cirosantilli Build HTML with https://github.com/ourbigbook/ourbigbook with "npm install && npx ourbigbook ." You can use this issue tracker for anything you want to tell me, even if it is not related to the repo. I also use this repo as generic issue tracker for myself.
The cast to intmax_t is to make sure that we have a type large enough to represent uid.
You can see all the possible fields of stat at the POSIX docs. Structs are documented with the headers they are in, in this case stat.h.
Please take a look at the sources I cited in the comment before asking further questions. This is a basic question which you should be able to find on most books, and we at stackoverflow just don't want to duplicate answers too much. Don't be discouraged by downvotes =)
You can do this in a POSIX compliant way with
opendir
,readdir
andstat
:And compile with:
The cast to
intmax_t
is to make sure that we have a type large enough to represent uid.You can see all the possible fields of stat at the POSIX docs. Structs are documented with the headers they are in, in this case
stat.h
.Please take a look at the sources I cited in the comment before asking further questions. This is a basic question which you should be able to find on most books, and we at stackoverflow just don't want to duplicate answers too much. Don't be discouraged by downvotes =)