----------------------------------------------------------------------------- either time param COULD be null. -----------------------------------------------------------------------------
| 673 | // either time param COULD be null. |
| 674 | //----------------------------------------------------------------------------- |
| 675 | bool Platform::getFileTimes(const char *path, FileTime *createTime, FileTime *modifyTime) |
| 676 | { |
| 677 | // MacOSX is NOT guaranteed to be running off a HFS volume, |
| 678 | // and UNIX does not keep a record of a file's creation time anywhere. |
| 679 | // So instead of creation time we return changed time, |
| 680 | // just like the Linux platform impl does. |
| 681 | if (!path || !*path) |
| 682 | return false; |
| 683 | |
| 684 | struct stat statData; |
| 685 | |
| 686 | if (stat(path, &statData) == -1) |
| 687 | return false; |
| 688 | |
| 689 | if(createTime) |
| 690 | *createTime = statData.st_ctime; |
| 691 | |
| 692 | if(modifyTime) |
| 693 | *modifyTime = statData.st_mtime; |
| 694 | |
| 695 | return true; |
| 696 | |
| 697 | |
| 698 | } |
| 699 | |
| 700 | |
| 701 | //----------------------------------------------------------------------------- |