aboutsummaryrefslogtreecommitdiff
path: root/src/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/io.h')
-rw-r--r--src/io.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/io.h b/src/io.h
index 676ebac..69caa5e 100644
--- a/src/io.h
+++ b/src/io.h
@@ -56,6 +56,13 @@ bool is_regular_file(int fd) {
return S_ISREG(fd_stat.st_mode);
}
+bool is_regular_file(const char* path) {
+ struct stat fd_stat;
+ lstat(path, &fd_stat);
+
+ return S_ISREG(fd_stat.st_mode);
+}
+
}
#endif // CHANGE_SRC_IO_H_