• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Test for BSD subsystem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test for BSD subsystem


  • Subject: Re: Test for BSD subsystem
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 09 Jan 2003 14:21:13 +0100

Reinhold Penner wrote:

What is a fail-safe way to determine whether or not the BSD subsystem is installed? I have tried to do shell scripts with commands that supposedly only work with BSD subsystem installed (e.g. "apropos")


The concept of BSD subsystem is likely to be fluctuent, depending on the OS version.
On the other hand, it could be that just checking for the presence of some files suffices.
I would suggest something like this:

set wantedFiles to {"/usr/bin/apropos", "/usr/bin/dummy"}
set bsdLikelyThere to true
repeat with f in wantedFiles
try
POSIX file f as alias
on error
set bsdLikelyThere to false
end try
end repeat

as it could prove to be more efficient than launching shell processes, as well as more versatile.

and catch an error, but some users got errors even though the BSD subsystem was installed.


I suppose it was a matter of user's permissions? Or something else?

Is there a Gestalt value for this?


I don't know.

Or anything that will work reliably?


You could test for the existence of that file:

/Library/Receipts/BSD.pkg

This of course assumes that users usually don't interfere with system files.



TIA for any pointers, -Reinhold


HTH,
Axel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Test for BSD subsystem
      • From: Harald E Brandt <email@hidden>
References: 
 >Test for BSD subsystem (From: Reinhold Penner <email@hidden>)

  • Prev by Date: Re: New Version of SuperPrivacy to support Safari released
  • Next by Date: Re: Safari again
  • Previous by thread: Test for BSD subsystem
  • Next by thread: Re: Test for BSD subsystem
  • Index(es):
    • Date
    • Thread