1

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?

eykanal
  • 335
  • 1
  • 2
  • 13

2 Answers2

0

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.

mdpc
  • 11,856
  • 28
  • 53
  • 67
  • Fair enough. I don't mind just checking in the most likely places, though. Are there other likely locations? – eykanal Nov 01 '11 at 16:35
-1
locate opendiff

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

egorgry
  • 2,871
  • 2
  • 23
  • 21
  • 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 01 '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 01 '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 01 '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 01 '11 at 16:51
  • Kinda silly that this was voted down when I answered based on the limited information provided. – egorgry Nov 01 '11 at 16:56