Differences From Artifact [07c4c6e7ac]:
- File src/OFFileIRIHandler.m — part of check-in [e76f2e482a] at 2022-12-04 23:01:31 on branch trunk — Include <syslimits.h> on DJGPP for PATH_MAX (user: js, size: 36400) [annotate] [blame] [check-ins using]
To Artifact [46b3e609f3]:
- File
src/OFFileIRIHandler.m
— part of check-in
[ede0671032]
at
2022-12-24 22:04:16
on branch trunk
— OFFileIRIHandler: Translate EACCES on Windows
The _utime family of functions does not work on directories on Windows, in
which case it returns a rather surprising EACCES. Translate it to EISDIR,
which is more expected. (user: js, size: 36620) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
666 667 668 669 670 671 672 | struct __utimbuf64 times = { .actime = (__time64_t)lastAccessDate.timeIntervalSince1970, .modtime = (__time64_t)modificationDate.timeIntervalSince1970 }; | | > > > > > | > | > > > > > | > | 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 | struct __utimbuf64 times = { .actime = (__time64_t)lastAccessDate.timeIntervalSince1970, .modtime = (__time64_t)modificationDate.timeIntervalSince1970 }; if (_wutime64FuncPtr([path UTF16String], ×) != 0) { int errNo = errno; if (errNo == EACCES && [self directoryExistsAtIRI: IRI]) errNo = EISDIR; @throw [OFSetItemAttributesFailedException exceptionWithIRI: IRI attributes: attributes failedAttribute: attributeKey errNo: errNo]; } } else { struct _utimbuf times = { .actime = (time_t)lastAccessDate.timeIntervalSince1970, .modtime = (time_t)modificationDate.timeIntervalSince1970 }; int status; if ([OFSystemInfo isWindowsNT]) status = _wutime([path UTF16String], ×); else status = _utime( [path cStringWithEncoding: [OFLocale encoding]], ×); if (status != 0) { int errNo = errno; if (errNo == EACCES && [self directoryExistsAtIRI: IRI]) errNo = EISDIR; @throw [OFSetItemAttributesFailedException exceptionWithIRI: IRI 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; |
︙ | ︙ |