ディレクトリ内のすべてのファイルを削除するにはどうすればよいですか?私はrmdirを、インターネットで提案されている他の方法を使用しましたが、誰も私を助けていない:これは、それらのいずれかです。(私は、現在の作業ディレクトリ内のディレクトリのTMPを削除する)C++でディレクトリとその中のすべてのファイルを削除するにはどうしたらいいですか?
removeDir()
{
char currentPath[_MAX_PATH];
GetCurrentPath(currentPath);
std::string tmp(currentPath);
string path = tmp + "\\temp";
std::string command = "del ";
std::string Path = path + "1.txt";
cout << Path << endl;
system(command.append(Path).c_str());
}
GetCurrentPath(char* buffer)
{
getcwd(buffer, _MAX_PATH);
}
OPを行うことができますディレクトリ – fazo
-1について尋ね、尋ね何行いません。 – MSalters
OPと私は明らかに彼が受け入れたので秘密の言葉を話します:) – JAM