Re:The everything-is-a-file principle – Linus Torvalds
by gaius on Sunday July 15, 2018 @03:58AM
(#17534276)
You `open()` a directory, and `getdents()` takes that file descriptor as input.
“These are not the interfaces you are interested in. Look at readdir(3) for the POSIX-conforming C library interface.” — getdents manpage
On Linux? You `open()` a directory, and `getdents()` takes that file descriptor as input.