utime.cpp 370 B

123456789101112131415161718
  1. #include "../system/utime.h"
  2. #ifdef _MSC_VER
  3. #include <sys/utime.h>
  4. #else
  5. #include <utime.h>
  6. #endif
  7. int TouchFile(const char* filePath) {
  8. return utime(filePath, nullptr);
  9. }
  10. int SetModTime(const char* filePath, time_t modtime, time_t actime) {
  11. struct utimbuf buf;
  12. buf.modtime = modtime;
  13. buf.actime = actime;
  14. return utime(filePath, &buf);
  15. }