As the title says, I want to determine whether the opendiff wrapper for FileMerge.app is present. I know of at least two places it can be located:

  • /usr/bin/opendiff
  • /Developer/usr/bin/opendiff

Is there a foolproof way to determine whether it's there - and, by extension, whether it can be launched by the user?

link|improve this question

feedback

2 Answers

I'd say there is no foolproof way. Oh using the various utilities, you can make some educated guesses but nothing 100%. Remember this also could be installed in /usr/local/bin/opendiff among other places.

link|improve this answer
Fair enough. I don't mind just checking in the most likely places, though. Are there other likely locations? – eykanal Nov 1 '11 at 16:35
feedback
locate opendiff

From the terminal will tell you where it's installed.

link|improve this answer
I thought about this, but this assumes their locate database exists, which - for users who shut down every night and never allow the periodic script to run - is not necessarily a good assumption. Correct me if I'm wrong here, though. – eykanal Nov 1 '11 at 16:37
I don't know of any other sure fire way. which opendiff or the find command which could be slow. – egorgry Nov 1 '11 at 16:43
This only works if the update process runs. And generally a lot of people remove it. Aside from that how do you know that is THE one that would be run. There could be many different opendiff programs out there. – mdpc Nov 1 '11 at 16:48
You're right. The which command when executed as the user will show which binary is in the path but you've already expressed your limitations with that. I voted the question up and hope to see a more creative answer. – egorgry Nov 1 '11 at 16:51
Kinda silly that this was voted down when I answered based on the limited information provided. – egorgry Nov 1 '11 at 16:56
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.