| 218 | } |
| 219 | |
| 220 | int UTIL_isSameFile(const char* fName1, const char* fName2) |
| 221 | { |
| 222 | assert(fName1 != NULL); assert(fName2 != NULL); |
| 223 | #if defined(_MSC_VER) || defined(_WIN32) |
| 224 | /* note : Visual does not support file identification by inode. |
| 225 | * inode does not work on Windows, even with a posix layer, like msys2. |
| 226 | * The following work-around is limited to detecting exact name repetition only, |
| 227 | * aka `filename` is considered different from `subdir/../filename` */ |
| 228 | return !strcmp(fName1, fName2); |
| 229 | #else |
| 230 | { stat_t file1Stat; |
| 231 | stat_t file2Stat; |
| 232 | return UTIL_stat(fName1, &file1Stat) |
| 233 | && UTIL_stat(fName2, &file2Stat) |
| 234 | && (file1Stat.st_dev == file2Stat.st_dev) |
| 235 | && (file1Stat.st_ino == file2Stat.st_ino); |
| 236 | } |
| 237 | #endif |
| 238 | } |
| 239 | |
| 240 | /* UTIL_isFIFO : distinguish named pipes */ |
| 241 | int UTIL_isFIFO(const char* infilename) |
no test coverage detected