diff options
Diffstat (limited to 'nix/libutil/util.cc')
| -rw-r--r-- | nix/libutil/util.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc index 95f293ff10f..72c8d38bd50 100644 --- a/nix/libutil/util.cc +++ b/nix/libutil/util.cc | |||
| @@ -287,6 +287,13 @@ unsigned char getFileType(const Path & path) | |||
| 287 | return DT_UNKNOWN; | 287 | return DT_UNKNOWN; |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | bool isPlainFile(const Path & path) | ||
| 291 | { | ||
| 292 | struct stat st = lstat(path); | ||
| 293 | return S_ISREG(st.st_mode) | ||
| 294 | && ((st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0); | ||
| 295 | } | ||
| 296 | |||
| 290 | 297 | ||
| 291 | string readFile(int fd) | 298 | string readFile(int fd) |
| 292 | { | 299 | { |
