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:
parent
1c208f2b7e
commit
daf3f2c11f
7 changed files with 48 additions and 46 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue