| 32 | static void fxReportError(txString theFormat, ...); |
| 33 | |
| 34 | txString fxRealDirectoryPath(txString path, txString buffer) |
| 35 | { |
| 36 | #if mxWindows |
| 37 | DWORD attributes; |
| 38 | if (_fullpath(buffer, path, C_PATH_MAX) != NULL) { |
| 39 | attributes = GetFileAttributes(buffer); |
| 40 | if ((attributes != 0xFFFFFFFF) && (attributes & FILE_ATTRIBUTE_DIRECTORY)) { |
| 41 | strcat(buffer, "\\"); |
| 42 | return buffer; |
| 43 | } |
| 44 | } |
| 45 | #else |
| 46 | struct stat a_stat; |
| 47 | if (realpath(path, buffer) != NULL) { |
| 48 | if (stat(buffer, &a_stat) == 0) { |
| 49 | if (S_ISDIR(a_stat.st_mode)) { |
| 50 | strcat(buffer, "/"); |
| 51 | return buffer; |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | #endif |
| 56 | return NULL; |
| 57 | } |
| 58 | |
| 59 | txString fxRealFilePath(txString path, txString buffer) |
| 60 | { |