how to remove directory in linux which is not empty [duplicate]
Possible Duplicate:
How to remove a non-empty directory in C++?
I have the directory name. i am trying remove(dir_name), but as the directory is not empty its returning false.
How can i delete the directory. Is there any built-in function
which i can call??
To recursively remove a directory and all it's contents, use the following command in a terminal:
rm -rf /path/to/dir
Edit: Seems I was confused by your mention of built-in function
, I was assuming a function "built into" linux. Obviously this is not C++ code. If that's what you want, see the question linked to in Fred Larson's comment to your original question.
精彩评论