> On Dec 21, 2019, at 10:18 AM, Gabriel Zachmann via Cocoa-dev > <cocoa-dev@lists.apple.com> wrote: > > Right. I was hoping there is an easy way to do this. > Something like a recursive check sum over the whole directory tree that the > OS might keep. > I don't want to do a complete tree traversal every time the app launches.
I think you'll need to do it yourself. The FSEvents API isn't going to keep an infinitely long history; it certainly won't go back to before the time the OS booted. You can shorten the traversal by keeping the mod date of every directory. Then if the mod date hasn't changed, you don't need to scan the directory contents. You can keep the data set smaller by keeping only a hash of the collected names/mod dates/sizes of the files in each directory. But you do need to keep the info for each subdirectory to do the above optimization. —Jens _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com