Cocoa, FSEvents, kFSEventStreamCreateFlagFileEvents flag and “renamed” events

前端 未结 3 1386
逝去的感伤
逝去的感伤 2021-02-09 06:11

I\'ve been playing with FSEvents in a little application of mine to synchronize the content of my application with what\'s on the hard drive (basically, it\'s a lit

3条回答
  •  孤城傲影
    2021-02-09 06:59

    You can get the file ID by creating an URL from the path, then calling:

    NSString *fileID = nil;
    
    [url getResourceValue:&fileID forKey:NSURLFileResourceIdentifierKey error:&error]; //NS_AVAILABLE(10_7, 5_0);
    

    (This identifier is not persistent across system restarts)

提交回复
热议问题