Re: determine whether an ancillary program/task can run
Re: determine whether an ancillary program/task can run
- Subject: Re: determine whether an ancillary program/task can run
- From: Martin Wierschin <email@hidden>
- Date: Thu, 01 Sep 2011 15:24:07 -0700
>> Thanks for your reply. I was hoping to avoid handling that inspection myself, but even if I go that route there's another problem: the ancillary tool isn't a proper bundle, it's just a plain executable, so NSBundle's initializers will just return nil. That's a pity because there's even -[NSBundle preflightAndReturnError:] which sounds to be exactly what I want.
>>
>> Offhand does anyone know how to inspect the architecture(s) of a plain executable file? I've been googling for a little bit and haven't hit upon anything that works yet.
>
> Won't otool do the job for you?
Yes, as would "lipo -info" or "file", but running/parsing another tool's output just for this seems a bit silly.
In terms of functions I can call, I found "dlopen_preflight", but it seems to fail, even when I know my tool can be run via NSTask.
~Martin
_______________________________________________
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