Just throwing out a request to anyone who knows an easy/simple way to delete dirs with nested subdirs and files It would be one directory with multiple subdirs (also with subdirs) and dozens of files each.

It's really icky though, in the technical sense of the word. Your code expects directory structures to be of a certain depth, and treats every file as a directory and tries to open it. This solution is not scalable.

Think about how to get it done in a general matter.

1. open a directory 2. for each file: 2a. skip the file if it's . or .. 2b. if it's a directory, go to 1 2c. if it's a file, delete it 3. delete the directory

We can tell this is going to be a recursive type of operation. Let's write the pseudocode for the function.

Yes, I see what you've done. Nice. The code I posted was reporting the files and directories as it went, (I already knew how deep it needed to go.) I was having permission problems and a couple dirs were being stubborn. I've got that fixed, and simplified the code down to three lines. ;-) However, one thing I found, and the main reason why I wasn't detecting file/dir types was the -d switch was not returning a true under any case! Neither -f or -d returned true values. I'm working on an NT server, with all UNIX/LINUX experience, so small differences are expected, but that took me by surprise. Any ideas?

The reason none of the files show up as a file or a directory is because readdir() returns the NAME of the file, not the PATH to the file. You need to prepend the path to the file (like is shown in my code).