How can you distinct between link and file when using readdir
Hello everyone
I am writing a program which will read a directory
and call rm to delete any file it encourage but spare
the directory, And it will dive into subdirectory until
all file is deleted
But when I use readdir I see that it can open symbolic
and file also. Because this program is dangerous, I don't
want it to follow the link to another folder, It may earase
all my hardisk in this way.
Do you know any way to recognize a link when anything
you have is a name??
|