Skip to content

Instantly share code, notes, and snippets.

@tempelmann
Last active September 15, 2020 16:23
Show Gist options
  • Select an option

  • Save tempelmann/2b93e1aba69aa3a2733a7718c30a8a8e to your computer and use it in GitHub Desktop.

Select an option

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.
#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;
}
@tempelmann

Copy link
Copy Markdown
Author

Reported to Apple as FB8695377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment