Differences From Artifact [db7a703dd2]:
- File
src/OFFileURLHandler.m
— part of check-in
[9135c5fcb8]
at
2021-04-04 18:46:33
on branch trunk
— Change -[contentsOfURLAtPath:] to return URLs
Returning strings is confusing for many as Foundation returns URLs here,
and URLs are often easier to work with during directory enumeration
anyway (no need to constantly append the current item to the base path). (user: js, size: 37049) [annotate] [blame] [check-ins using] [more...]
To Artifact [26c778d535]:
- File src/OFFileURLHandler.m — part of check-in [8c0d76f782] at 2021-04-17 00:51:42 on branch new-naming-convention — of_time_interval_t -> OFTimeInterval (user: js, size: 37012) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
85 86 87 88 89 90 91 | # endif #endif #if defined(OF_WINDOWS) || defined(OF_AMIGAOS) typedef struct { of_offset_t st_size; unsigned int st_mode; | | | | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | # endif #endif #if defined(OF_WINDOWS) || defined(OF_AMIGAOS) typedef struct { of_offset_t st_size; unsigned int st_mode; OFTimeInterval st_atime, st_mtime, st_ctime; # ifdef OF_WINDOWS # define HAVE_STRUCT_STAT_ST_BIRTHTIME OFTimeInterval st_birthtime; DWORD fileAttributes; # endif } of_stat_t; #elif defined(HAVE_STAT64) typedef struct stat64 of_stat_t; #else typedef struct stat of_stat_t; |
︙ | ︙ | |||
130 131 132 133 134 135 136 | static int (*func__wutime64)(const wchar_t *, struct __utimbuf64 *); static WINAPI BOOLEAN (*func_CreateSymbolicLinkW)(LPCWSTR, LPCWSTR, DWORD); static WINAPI BOOLEAN (*func_CreateHardLinkW)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES); #endif #ifdef OF_WINDOWS | | | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | static int (*func__wutime64)(const wchar_t *, struct __utimbuf64 *); static WINAPI BOOLEAN (*func_CreateSymbolicLinkW)(LPCWSTR, LPCWSTR, DWORD); static WINAPI BOOLEAN (*func_CreateHardLinkW)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES); #endif #ifdef OF_WINDOWS static OFTimeInterval filetimeToTimeInterval(const FILETIME *filetime) { return (double)((int64_t)filetime->dwHighDateTime << 32 | filetime->dwLowDateTime) / 10000000.0 - 11644473600.0; } static int |
︙ | ︙ | |||
258 259 260 261 262 263 264 | #elif defined(OF_AMIGAOS) BPTR lock; # ifdef OF_AMIGAOS4 struct ExamineData *ed; # else struct FileInfoBlock fib; # endif | | | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | #elif defined(OF_AMIGAOS) BPTR lock; # ifdef OF_AMIGAOS4 struct ExamineData *ed; # else struct FileInfoBlock fib; # endif OFTimeInterval timeInterval; struct Locale *locale; struct DateStamp *date; if ((lock = Lock([path cStringWithEncoding: [OFLocale encoding]], SHARED_LOCK)) == 0) return retrieveError(); |
︙ | ︙ | |||
311 312 313 314 315 316 317 | # ifdef OF_AMIGAOS4 date = &ed->Date; # else date = &fib.fib_Date; # endif timeInterval += date->ds_Days * 86400.0; timeInterval += date->ds_Minute * 60.0; | | | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | # ifdef OF_AMIGAOS4 date = &ed->Date; # else date = &fib.fib_Date; # endif timeInterval += date->ds_Days * 86400.0; timeInterval += date->ds_Minute * 60.0; timeInterval += date->ds_Tick / (OFTimeInterval)TICKS_PER_SECOND; buffer->st_atime = buffer->st_mtime = buffer->st_ctime = timeInterval; # ifdef OF_AMIGAOS4 FreeDosObject(DOS_EXAMINEDATA, ed); # endif |
︙ | ︙ | |||
699 700 701 702 703 704 705 | exceptionWithURL: URL attributes: attributes failedAttribute: attributeKey errNo: errno]; } #elif defined(OF_AMIGAOS) /* AmigaOS does not support access time. */ | | | 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 | exceptionWithURL: URL attributes: attributes failedAttribute: attributeKey errNo: errno]; } #elif defined(OF_AMIGAOS) /* AmigaOS does not support access time. */ OFTimeInterval modificationTime = modificationDate.timeIntervalSince1970; struct Locale *locale; struct DateStamp date; modificationTime -= 252460800; /* 1978-01-01 */ if (modificationTime < 0) |
︙ | ︙ | |||
735 736 737 738 739 740 741 | # endif @throw [OFSetItemAttributesFailedException exceptionWithURL: URL attributes: attributes failedAttribute: attributeKey errNo: retrieveError()]; #else | < | | | 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | # endif @throw [OFSetItemAttributesFailedException exceptionWithURL: URL attributes: attributes failedAttribute: attributeKey errNo: retrieveError()]; #else OFTimeInterval lastAccessTime = lastAccessDate.timeIntervalSince1970; OFTimeInterval modificationTime = modificationDate.timeIntervalSince1970; struct timeval times[2] = { { .tv_sec = (time_t)lastAccessTime, .tv_usec = (int)((lastAccessTime - times[0].tv_sec) * 1000000) }, |
︙ | ︙ |