| 57 | } |
| 58 | |
| 59 | txString fxRealFilePath(txString path, txString buffer) |
| 60 | { |
| 61 | #if mxWindows |
| 62 | DWORD attributes; |
| 63 | if (_fullpath(buffer, path, C_PATH_MAX) != NULL) { |
| 64 | attributes = GetFileAttributes(buffer); |
| 65 | if ((attributes != 0xFFFFFFFF) && (!(attributes & FILE_ATTRIBUTE_DIRECTORY))) { |
| 66 | return buffer; |
| 67 | } |
| 68 | } |
| 69 | #else |
| 70 | struct stat a_stat; |
| 71 | if (realpath(path, buffer) != NULL) { |
| 72 | if (stat(buffer, &a_stat) == 0) { |
| 73 | if (S_ISREG(a_stat.st_mode)) { |
| 74 | return buffer; |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | #endif |
| 79 | return NULL; |
| 80 | } |
| 81 | |
| 82 | void fxAbort(void* console, int status) |
| 83 | { |