diff options
Diffstat (limited to 'src/sys/sys_unix.c')
-rw-r--r-- | src/sys/sys_unix.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c index b05cf855..7660edd1 100644 --- a/src/sys/sys_unix.c +++ b/src/sys/sys_unix.c @@ -186,6 +186,21 @@ const char *Sys_Dirname( char *path ) } /* +============== +Sys_FOpen +============== +*/ +FILE *Sys_FOpen( const char *ospath, const char *mode ) { + struct stat buf; + + // check if path exists and is a directory + if ( !stat( ospath, &buf ) && S_ISDIR( buf.st_mode ) ) + return NULL; + + return fopen( ospath, mode ); +} + +/* ================== Sys_Mkdir ================== |