set value for NSURLAttributeModificationDateKey fails
Originator: | pzabelin | ||
Number: | rdar://23679944 | Date Originated: | 2015-11-28 |
Status: | Closed | Resolved: | 2016-07-08 |
Product: | iOS SDK | Product Version: | 8.0 |
Classification: | Documentation bug | Reproducible: | Always |
fileUrl.setResourceValue(referenceDate, forKey: NSURLAttributeModificationDateKey) silently fails to set new date
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Engineering has the following feedback for you: Documentation bug.
NSURLAttributeModificationDateKey, kCFURLAttributeModificationDateKey, and ATTR_CMN_CHGTIME are all read only. We’ve fixed the header file comments (this bug covers those changes). We’ve filed these new bug reports to fix the documentation: NSURLAttributeModificationDateKey and kCFURLAttributeModificationDateKey are read-only ATTR_CMN_CHGTIME is read-only -- getattrlist man page says it is read-write. Please provide your response or results by updating your bug report and compress any bundled files (e.g. nested folders) prior to uploading.
iOS 9.3 SDK headers are not updated
We just received Xcode7.3 with iOS 9.3 SDK
It contains NSURL.h, which states that NSURLAttributeModificationDateKey is Read-write:
FOUNDATION_EXPORT NSString * const NSURLAttributeModificationDateKey NS_AVAILABLE(10_6, 4_0); // The time the resource's attributes were last modified (Read-write, value type NSDate)
Also ATTR_CMN_CHGTIME documented as read/write in iOS man pages in Xcode Documentation:
Apple Engineering has provided the following feedback regarding this issue:
The NSURLAttributeModificationDateKey property is actually read-only and the comments in the header file have been changed to reflect this. NSURLAttributeModificationDateKey returns the value from getattrlist’s ATTR_CMN_CHGTIME attribute which is documented as “ATTR_CMN_CHGTIME cannot be set programmatically. Any attempt to set change time is ignored.”