diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:09 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:09 +0200 |
commit | 110fc5dee14fc7988f631a158e50d283446aba7a (patch) | |
tree | 7c19dfd3bdb8c4636409ec80a38c70499ac006db /zen/file_handling.cpp | |
parent | 5.14 (diff) | |
download | FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.gz FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.bz2 FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.zip |
5.15
Diffstat (limited to 'zen/file_handling.cpp')
-rw-r--r-- | zen/file_handling.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/zen/file_handling.cpp b/zen/file_handling.cpp index 3565700a..b529720f 100644 --- a/zen/file_handling.cpp +++ b/zen/file_handling.cpp @@ -35,12 +35,12 @@ #elif defined FFS_MAC #include <sys/mount.h> //statfs -#include <utime.h> +//#include <utime.h> #endif #if defined FFS_LINUX || defined FFS_MAC #include <sys/stat.h> -//#include <sys/time.h> +#include <sys/time.h> //lutimes #endif using namespace zen; @@ -933,15 +933,18 @@ void zen::setFileTime(const Zstring& filename, const Int64& modTime, ProcSymlink } #endif -#elif defined FFS_LINUX - struct ::timespec newTimes[2] = {}; - newTimes[0].tv_nsec = UTIME_OMIT; //omit access time - newTimes[1].tv_sec = to<time_t>(modTime); //modification time (seconds) +#elif defined FFS_LINUX || defined FFS_MAC + //sigh, we can't use utimensat on NTFS volumes on Ubuntu: silent failure!!! what morons are programming this shit??? - if (::utimensat(AT_FDCWD, filename.c_str(), newTimes, procSl == SYMLINK_DIRECT ? AT_SYMLINK_NOFOLLOW : 0) != 0) - throw FileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filename)) + L"\n\n" + getLastErrorFormatted()); + // struct ::timespec newTimes[2] = {}; + // newTimes[0].tv_nsec = UTIME_OMIT; //omit access time + // newTimes[1].tv_sec = to<time_t>(modTime); //modification time (seconds) + // + // if (::utimensat(AT_FDCWD, filename.c_str(), newTimes, procSl == SYMLINK_DIRECT ? AT_SYMLINK_NOFOLLOW : 0) != 0) + // throw FileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filename)) + L"\n\n" + getLastErrorFormatted()); + + //=> fallback to "retarded-idiot version"! -- DarkByte -#elif defined FFS_MAC struct ::timeval newTimes[2] = {}; newTimes[0].tv_sec = ::time(nullptr); //access time (seconds) newTimes[1].tv_sec = to<time_t>(modTime); //modification time (seconds) |