bass20
asked on
Manipulating Directories
Hello!
How can I manipulate directories in C (create, delete, search for, etc...) without using system("")?
Thanx!
How can I manipulate directories in C (create, delete, search for, etc...) without using system("")?
Thanx!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To count the number of files (and not sub directories)
you need to
opendir()
then use scandir/readdir to scan the directory
for each entry do a stat()
determine the type of entry (file/special file/fifo/device/directory /link)
if file then increment count
you need to
opendir()
then use scandir/readdir to scan the directory
for each entry do a stat()
determine the type of entry (file/special file/fifo/device/directory
if file then increment count
ASKER