910705 - rmdir() doesn't remove empty dirs.
i may use system("rm -r ...") instead of rmdir("..."), because rmdir() has no option to remove files inside the dir as well as the dir itself and it expects it to be empty.
but, is there any better way not to call a shell command? thx |
Hi,
would help if you said what language you are using. Evo2. |
C/C++
|
Hi,
for c++ I'd use boost. For example Code:
#include "boost/filesystem.hpp" Code:
mkdir -p foo/bar foo/baz Evo2. |
thx. it's indeed an additional library and this means that it's not possible to do it with a call to a standard library API, right?
|
Hi,
Correct. AFAIR not all OSs have the concept of directories, this is why there are no native c/c++ builtins for anything to do with directories. IMHO, using libraries like boost is preferable over shell commands. Evo2. |
See https://www.gnu.org/software/libc/ma...Deleting-Files for unlink, rmdir, remove
|
All times are GMT -5. The time now is 03:11 AM. |