aboutsummaryrefslogtreecommitdiff
path: root/src/std/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/std/file.c')
-rw-r--r--src/std/file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/std/file.c b/src/std/file.c
index 84f4b0c..3ca94b0 100644
--- a/src/std/file.c
+++ b/src/std/file.c
@@ -176,6 +176,10 @@ typedef enum {
OTHER
} FileType;
+/*
+ TODO: Remove this and instead use fstat, and then read the file.
+ Otherwise this is not atomic and the file type can change between the calls
+*/
static CHECK_RESULT int file_get_type(const char *filepath, FileType *type) {
struct stat file_stats;
if(stat(filepath, &file_stats) == -1) {