tango-2
tango-2

Reputation: 94

read directories withoud readdir

I'm working on POSIX linux to learn. I'm using C Programming Languages.

I want to read a folder, but instead of using readdir or opendir, I want to use pure open and read, I want to extract subfolders or files in this folder as names as string.

Is this possible with open() and read() as open and read (without using dirent.h)?

Upvotes: 0

Views: 199

Answers (1)

AKX
AKX

Reputation: 168824

Simply put: no, it's not.

open() and read() operate on files, not directories.

opendir() and readdir() operate on directories, not files.

Upvotes: 1

Related Questions