Index: src/OFFileURLHandler.m ================================================================== --- src/OFFileURLHandler.m +++ src/OFFileURLHandler.m @@ -22,14 +22,18 @@ #ifdef HAVE_DIRENT_H # include #endif #include "unistd_wrapper.h" +#import "platform.h" #ifdef HAVE_SYS_STAT_H # include #endif #include +#ifdef OF_WINDOWS +# include +#endif #ifdef HAVE_PWD_H # include #endif #ifdef HAVE_GRP_H @@ -603,10 +607,23 @@ ofItemAtURL: (OFURL *)URL attributes: (of_file_attributes_t)attributes { of_time_interval_t timeInterval = date.timeIntervalSince1970; OFString *path = URL.fileSystemRepresentation; +#ifdef OF_WINDOWS + struct __utimbuf64 times = { + (__time64_t)timeInterval, + (__time64_t)timeInterval + }; + + if (_wutime64([path UTF16String], ×) != 0) + @throw [OFSetItemAttributesFailedException + exceptionWithURL: URL + attributes: attributes + failedAttribute: of_file_attribute_key_modification_date + errNo: errno]; +#else struct timeval times[2] = { { .tv_sec = (time_t)timeInterval, .tv_usec = (int)((timeInterval - times[0].tv_sec) * 1000) @@ -618,10 +635,11 @@ @throw [OFSetItemAttributesFailedException exceptionWithURL: URL attributes: attributes failedAttribute: of_file_attribute_key_modification_date errNo: errno]; +#endif } - (void)of_setPOSIXPermissions: (OFNumber *)permissions ofItemAtURL: (OFURL *)URL attributes: (of_file_attributes_t)attributes