Last active
September 15, 2020 16:23
-
-
Save tempelmann/2b93e1aba69aa3a2733a7718c30a8a8e to your computer and use it in GitHub Desktop.
Demonstrates a bug in Big Sur (b6) with APFS volumes having non-ASCII names. To reproduce, rename any APFS volume so that it contains an "ü" in it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| int main(int argc, const char * argv[]) { | |
| NSArray<NSURL*> *vols = [NSFileManager.defaultManager mountedVolumeURLsIncludingResourceValuesForKeys:nil options:0]; | |
| for (NSURL *url1 in vols) { | |
| NSURL *url2 = [NSURL fileURLWithPath:url1.path]; | |
| if (! [url1 isEqual:url2]) { | |
| NSLog(@"url mismatch: %@ - %@", url1, url2); | |
| if (! [url1.path isEqualToString:url2.path]) { | |
| NSLog(@"path mismatch: %@ - %@", url1.path, url2.path); | |
| } | |
| NSLog(@"url1's VolID: %@", [url1 resourceValuesForKeys:@[NSURLVolumeIdentifierKey] error:nil][NSURLVolumeIdentifierKey]); | |
| NSLog(@"url2's VolID: %@", [url2 resourceValuesForKeys:@[NSURLVolumeIdentifierKey] error:nil][NSURLVolumeIdentifierKey]); | |
| } | |
| } | |
| return 0; | |
| } |
Author
Author
Reported to Apple as FB8695377
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's curious that while both the NSURLs and their paths do not test as equal, their Volume IDs are equal!
So, obviously, [NSURL isEqual] does not use the NSURLVolumeIdentifierKey for its test. It probably uses the URL's path.