On Tuesday, June 3, 2003, at 08:08 PM, [EMAIL PROTECTED] wrote:


Is there a way to detect if the BSD libraries have been installed on a user's Mac OS X system?� From my understanding, the default OS X install comes with the BSD libraries, however, if the user for some reason has opted to disable them, certain unix calls I've been using fail in Revolution, like the "grep" command.� I suppose I could do a test to see if the grep command gives an error, but wonder if there's a better way.

I haven't tested this, but guessing you could check for the existence of /Library/Receipts/BSD.pkg


However, it would be more robust to check for existence command before you use shell(). The user could have modified the contents of /usr/bin/. This might be especially common among users of Fink who install bunches of stuff into /sw/bin. Maybe they leave /usr/bin alone and just change their path, or maybe they delete stuff? To be really robust, use which to locate the command in question:

# which which
/usr/bin/which

Unix is so weird! :-)

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
[EMAIL PROTECTED]
[EMAIL PROTECTED]



_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to