done
This commit is contained in:
parent
c1e6dc2f7c
commit
88b3272939
|
@ -46,16 +46,16 @@ bool listFileAndType(const string &dir) {
|
||||||
case DT_LNK:
|
case DT_LNK:
|
||||||
lnkcnt++;
|
lnkcnt++;
|
||||||
// char* linkname;
|
// char* linkname;
|
||||||
char linkname[buf.st_size + 1];
|
// char linkname[buf.st_size + 1];
|
||||||
// linkname = malloc(buf.st_size + 1);
|
// linkname = malloc(buf.st_size + 1);
|
||||||
ssize_t r;
|
// ssize_t r;
|
||||||
r = readlink(statpath.c_str(), linkname, buf.st_size + 1);
|
// r = readlink(statpath.c_str(), linkname, buf.st_size + 1);
|
||||||
linkname[buf.st_size] = '\0';
|
// linkname[buf.st_size] = '\0';
|
||||||
cout << "[l] ";
|
cout << "[l] ";
|
||||||
cout << statpath << " points to " << linkname;
|
// cout << statpath << " points to " << linkname;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cout << "[none] ";
|
cout << "[no type] ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ht[dp->d_ino] = true;
|
ht[dp->d_ino] = true;
|
||||||
|
|
Loading…
Reference in New Issue