On Apr 17, 2013, at 4:07 PM, Ken Thomases wrote: >> Question is: what's the easiest way to detect it having been moved? I >> thought I'd get lucky and somewhere there'd be a handy notification, but I >> don't see one. It looks like I'll have to use the FSEvent API? I'm not a fan >> of it, so I'm hoping there's a slimmer solution. > > You can use kqueue() to monitor a vnode for various modifications. In this > case, you'd monitor the directory which contains your app bundle, since > moving it means removing the entry for it from there. Obviously, not all > modifications will be your app being moved, so you'd have to check.
Yeah, same deal as FSEvent. > That said, this seems like checking that the user hasn't poured molasses into > their computer's vents. If the user is determined to break their system, > there's nothing you'll be able to do to stop them. They're not determined, they just don't know it'll break things — Finder didn't even warn me when I was doing it. This is not the user's fault and it's happening often enough I want to do something about it. -- Seth Willits _______________________________________________ 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