counting
If i want to write a C program in counting the no of file in a folder, what should i do?
|
Here is borrowed from Mr.Ritchie :D
Code:
Now you may use stat system call to determine if your name is a directory (take a look at manual page of stat). Code:
Dirent *dp; P.S. I'va wrote it in a hurry so check out the man pages on any question. |
Re: counting
Quote:
Code:
#include <sys/types.h> |
This gives the number of files in directory....
Code:
#include<dirent.h> |
All times are GMT -5. The time now is 12:51 PM. |