Skip to content

Instantly share code, notes, and snippets.

@TimOliver
Created September 29, 2019 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimOliver/ec972773a5de9e425a3c8cf6f8900c63 to your computer and use it in GitHub Desktop.
Save TimOliver/ec972773a5de9e425a3c8cf6f8900c63 to your computer and use it in GitHub Desktop.
The necessary code to set up access to the document identifier of files in the iOS file system
#import <sys/stat.h>
chflags(filePath.UTF8String, UF_TRACKED);
NSURL *url = [NSURL fileURLWithPath:filePath];
id value = nil;
[url getResourceValue:&value forKey:NSURLDocumentIdentifierKey error:nil];
NSLog(@"%@", value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment