To find if a binary is being used/running
To find if a binary is being used/running
- Subject: To find if a binary is being used/running
- From: Nick Rogers <email@hidden>
- Date: Fri, 04 Oct 2013 12:38:14 +0530
Hi,
I need to know if a binary is executing or not. I just have the path to the binary e.g. /Applications/MyApp.app/Contents/MacOS/MyApp
There's NSRunningApplication method runningApplicationsWithBundleIdentifier: , but I have other binaries which are embedded in this app which don't have a bundle id. And I want to know if they are running or not.
Cocoa doesn't seem have any such specific API for this purpose. NSFileHandle provides a valid handle (for writing) even if the binary is executing.
Is there any method like open() or something which would fail if binary is executing. Tried open() with flags O_EXLOCK but no luck yet.
Is this even possible?
Best,
Nick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden