Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|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
locate opendiff

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

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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