| 618 | } |
| 619 | |
| 620 | txString fxRealDirectoryPath(txLinker* linker, txString path) |
| 621 | { |
| 622 | #if mxWindows |
| 623 | char buffer[C_PATH_MAX]; |
| 624 | DWORD attributes; |
| 625 | if (_fullpath(buffer, path, C_PATH_MAX) != NULL) { |
| 626 | attributes = GetFileAttributes(buffer); |
| 627 | if ((attributes != 0xFFFFFFFF) && (attributes & FILE_ATTRIBUTE_DIRECTORY)) { |
| 628 | strcat(buffer, "\\"); |
| 629 | return fxNewLinkerString(linker, buffer, mxStringLength(buffer)); |
| 630 | } |
| 631 | } |
| 632 | #else |
| 633 | char buffer[C_PATH_MAX]; |
| 634 | struct stat a_stat; |
| 635 | if (realpath(path, buffer) != NULL) { |
| 636 | if (stat(buffer, &a_stat) == 0) { |
| 637 | if (S_ISDIR(a_stat.st_mode)) { |
| 638 | strcat(buffer, "/"); |
| 639 | return fxNewLinkerString(linker, buffer, mxStringLength(buffer)); |
| 640 | } |
| 641 | } |
| 642 | } |
| 643 | #endif |
| 644 | return NULL; |
| 645 | } |
| 646 | |
| 647 | txString fxRealFilePath(txLinker* linker, txString path) |
| 648 | { |
nothing calls this directly
no test coverage detected