Re: Test for BSD subsystem
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.