In Cocoa, how would I test if a file is an executable binary? Unfortunately, [NSFileManager isExecutableFileAtPath:] will also return true for scripts and directories, pretty much any file that has the executable bit set which is not what I want.
While doing it in straight-up Cocoa is my preferred approach, a Bash solution that I can easily wrap in an NSTask would be sufficient.