From daf3f2c11ff467b600473a2fda7bd513aacc1efa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Aug 2014 16:37:47 +0200 Subject: Make readDirectory() return inode / file type --- src/libutil/util.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/libutil/util.hh') diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 64250c522a..42215eb1d3 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -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 DirEntries; + +DirEntries readDirectory(const Path & path); /* Read the contents of a file into a string. */ string readFile(int fd); -- cgit 1.4.1