List regular files with ls(.. LS_FILES)

Currently it can give you a regular file, block/char device, fifo or a
socket.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
pull/703/head
Emil Velikov 2 years ago
parent 68ce8f81cc
commit ab684a2f24

@ -89,7 +89,7 @@ std::vector<std::string> ls(const char* root, const char* prefix, LS_FLAGS flags
continue;
if (((flags & LS_DIRS) && S_ISDIR(s.st_mode))
|| ((flags & LS_FILES) && !S_ISDIR(s.st_mode))) {
|| ((flags & LS_FILES) && S_ISREG(s.st_mode))) {
list.push_back(dp->d_name);
}
} else if (((flags & LS_DIRS) && dp->d_type == DT_DIR)

Loading…
Cancel
Save