Walk a directory/Recursively: Difference between revisions

Line 123:
if ( stat(entry->d_name, &fs) < 0 ) return;
if ( S_ISDIR(fs.st_mode) ) {
for(i=0; i < indent; i++) printfputc("' "');
puts(entry->d_name);
indent += 2;
Line 133:
} else {
if (!regexec(&reg, entry->d_name, 0, NULL, 0)) {
for(i=0; i < indent; i++) putc("' "');
puts(entry->d_name);
}
Anonymous user