通过objective C编码。我希望在将文件添加到连接到mac的USB时收到通知。我想要跟踪在it.Till上完成的所有I/O操作,现在我可以使用以下命令在连接和移除U盘时收到通知
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector: @selector(volumesChanged:) name:NSWorkspaceDidMountNotification object: nil];
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector: @selector(volumesRemoved:) name:NSWorkspaceDidUnmountNotification object:nil];同样,我也想知道什么时候对它执行了任何操作。任何帮助都是值得欣赏的。提前感谢
发布于 2015-06-17 15:33:16
您可以使用FSEvents监视文件系统更改。这是文档- https://developer.apple.com/library/mac/documentation/Darwin/Reference/FSEvents_Ref/
https://stackoverflow.com/questions/30884575
复制相似问题