#include <fstream>
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <string>
#include <cstdio>
#include <exception>
using namespace std;
int main ()
{
string file;
char result;
const string path = "/home/pablo/testee";
DIR* dir = opendir(path.c_str());
struct dirent* ent = 0;
while (dir && (ent = readdir(dir)))
{
try
{
system ("rm /home/pablo/testee/*.log");
}
catch (exception& e){}
}
closedir(dir);
return 0;
}
|