File src/utils/fs.c changed (mode: 100644) (index 1f98dbe75..dd8976d28) |
... |
... |
is_dir(const char path[]) |
76 |
76 |
static int |
static int |
77 |
77 |
is_dir_fast(const char path[]) |
is_dir_fast(const char path[]) |
78 |
78 |
{ |
{ |
79 |
|
#ifndef _WIN32 |
|
|
79 |
|
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(BSD) |
80 |
80 |
/* Optimization idea: is_dir() ends up using stat() call, which in turn has |
/* Optimization idea: is_dir() ends up using stat() call, which in turn has |
81 |
81 |
* to: |
* to: |
82 |
82 |
* 1) resolve path to an inode number; |
* 1) resolve path to an inode number; |
|
... |
... |
is_dir_fast(const char path[]) |
95 |
95 |
|
|
96 |
96 |
return access(path_to_selfref, F_OK) == 0; |
return access(path_to_selfref, F_OK) == 0; |
97 |
97 |
#else |
#else |
98 |
|
/* Windows reports that "/path/to/file/." is directory. */ |
|
|
98 |
|
/* Some systems report that "/path/to/file/." is directory... */ |
99 |
99 |
return 0; |
return 0; |
100 |
100 |
#endif |
#endif |
101 |
101 |
} |
} |