Re: Removing all files inside a directory in Linux using an API call from a C Code



On Oct 29, 10:22 pm, "Joachim Schmitz" <nospam.j...@schmitz-
digital.de> wrote:
"santosh" <santosh....@xxxxxxxxx> schrieb im Newsbeitragnews:fg4j30$gu$1@xxxxxxxxxxx> Aditya wrote:

On Oct 29, 2:18 pm, santosh <santosh....@xxxxxxxxx> wrote:
I also don't want to use system call,

What you want to do is inherently impossible to do without system calls,
unless you don't mind writing a kernel module.

system call vs. calling system()
Guess he meant the later

Bye, Jojo

Thanks Jojo
and thanks Santosh
I read both of you. I have already tried this and I actually don't
know what the dirent->d_name structure contains. It has the complete
listing of the files inside a directory, all padded with junk
data(most of them being NULL). First is how to extract the filenames
from this. Second the dirent->d_type always returns DT_DIR(==4),
irrespective of a subfolder existence. I am stuck here. I am also
unable to find a good tutorial on this. Please help out again.

bye
Aditya

.