diff --git a/src/stat_wrappers.c b/src/stat_wrappers.c index ffa0055..5b3f295 100644 --- a/src/stat_wrappers.c +++ b/src/stat_wrappers.c @@ -3,13 +3,13 @@ inline int idris_posix_stat_file_type(char *filename) { struct stat buffer; stat(filename, &buffer); - return buffer.st_mode & S_IFMT; + return buffer.st_mode; } inline int idris_posix_is_directory(char *filename) { - return idris_posix_stat_file_type(filename) == S_IFDIR; + return S_ISDIR(idris_posix_stat_file_type(filename)); } inline int idris_posix_is_file(char *filename) { - return idris_posix_stat_file_type(filename) == S_IFREG; + return S_ISREG(idris_posix_stat_file_type(filename)); }