diff --git a/src/system.c b/src/system.c index bdeb847..2581247 100755 --- a/src/system.c +++ b/src/system.c @@ -6274,6 +6274,13 @@ int ss_file_exist(const char *path) \********************************************************************/ { + // first check if path is a directory and if yes, return 0 + struct stat buf; + stat(path, &buf); + if (S_ISDIR(buf.st_mode)) + return 0; + + // check if the file exists int fd = open(path, O_RDONLY, 0); if (fd < 0) return 0;