1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 19:03:16 +02: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

@ -64,7 +64,16 @@ bool isLink(const Path & path);
/* Read the contents of a directory. The entries `.' and `..' are
removed. */
Strings readDirectory(const Path & path);
struct DirEntry
{
string name;
ino_t ino;
unsigned char type; // one of DT_*
};
typedef vector<DirEntry> DirEntries;
DirEntries readDirectory(const Path & path);
/* Read the contents of a file into a string. */
string readFile(int fd);