Hey all, How delete folder using C++? I am something find at internet, but do not help me :( Can somebody help me?
Thank you
Hey all, How delete folder using C++? I am something find at internet, but do not help me :( Can somebody help me?
Thank you
The C++ Standard defines the remove() function, which may or may not delete a folder, depending on implementation. If it doesn't you need to use an implementation specific function such as rmdir().
The directory must be empty and your program must have permissions to delete it
but the function called rmdir will do it
rmdir("C:/Documents and Settings/user/Desktop/itsme")
The directory should be empty.
BOOL RemoveDirectory( LPCTSTR lpPathName );
As far as I can tell, there are no classes/functions in C++ to interact with directories.
You will need to use the C/C++ facilities of your operating system libraries.
I strongly advise to use Boost.FileSystem.
http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/index.htm
In your case that would be
boost::filesystem::remove_all(yourPath)