| 606 | } |
| 607 | |
| 608 | int fs_file_time(const char *name, time_t *created, time_t *modified) |
| 609 | { |
| 610 | #if defined(CONF_FAMILY_WINDOWS) |
| 611 | WIN32_FIND_DATAW finddata; |
| 612 | const std::wstring wide_name = windows_utf8_to_wide(name); |
| 613 | HANDLE handle = FindFirstFileW(wide_name.c_str(), &finddata); |
| 614 | if(handle == INVALID_HANDLE_VALUE) |
| 615 | return 1; |
| 616 | |
| 617 | *created = filetime_to_unixtime(&finddata.ftCreationTime); |
| 618 | *modified = filetime_to_unixtime(&finddata.ftLastWriteTime); |
| 619 | FindClose(handle); |
| 620 | #elif defined(CONF_FAMILY_UNIX) |
| 621 | struct stat sb; |
| 622 | if(stat(name, &sb)) |
| 623 | return 1; |
| 624 | |
| 625 | *created = sb.st_ctime; |
| 626 | *modified = sb.st_mtime; |
| 627 | #else |
| 628 | #error not implemented |
| 629 | #endif |
| 630 | |
| 631 | return 0; |
| 632 | } |
no test coverage detected