| 149 | } |
| 150 | |
| 151 | static bool pathExistsFile(StringSpan path) |
| 152 | { |
| 153 | #if SC_PLATFORM_WINDOWS |
| 154 | const DWORD attr = ::GetFileAttributesW(path.getNullTerminatedNative()); |
| 155 | return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) == 0; |
| 156 | #else |
| 157 | struct stat info; |
| 158 | return ::stat(path.getNullTerminatedNative(), &info) == 0 && S_ISREG(info.st_mode); |
| 159 | #endif |
| 160 | } |
| 161 | |
| 162 | static bool pathExistsDirectory(StringSpan path) |
| 163 | { |