Listing 1. DelEntry function
int DelEntry ( char * file, struct stat *sb,
int flag )
{
int result = 0;
switch ( flag )
{
case FTW_F: if ( remove ( file ) == ERROR )
{
cout << file << " not removed."
<< endl;
CheckErrNo ( file );
}
break;
case FTW_D: Stk.push ( file );
break;
case FTW_NS: cout << "Stat failure on: "
<< file << endl;
CheckErrNo ( file );
break;
case FTW_DNR: cout <<
"Directory cannot be read: "
<< file << endl;
CheckErrNo ( file );
break;
}
return result;
Copyright © 1994 - 2018 Linux Journal. All rights reserved.