1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-03 07:31:00 +01:00

Make readDirectory() return inode / file type

This commit is contained in:
Eelco Dolstra 2014-08-01 16:37:47 +02:00
parent 1c208f2b7e
commit daf3f2c11f
7 changed files with 48 additions and 46 deletions

View file

@ -42,12 +42,11 @@ Generations findGenerations(Path profile, int & curGen)
Path profileDir = dirOf(profile);
string profileName = baseNameOf(profile);
Strings names = readDirectory(profileDir);
for (Strings::iterator i = names.begin(); i != names.end(); ++i) {
for (auto & i : readDirectory(profileDir)) {
int n;
if ((n = parseName(profileName, *i)) != -1) {
if ((n = parseName(profileName, i.name)) != -1) {
Generation gen;
gen.path = profileDir + "/" + *i;
gen.path = profileDir + "/" + i.name;
gen.number = n;
struct stat st;
if (lstat(gen.path.c_str(), &st) != 0)