[X-Unix] how to determine if FW drive is attached

Chris Garaffa chris at nilzero.com
Mon Sep 5 20:22:42 PDT 2005


On Sep 5, 2005, at 11:06 PM, Timothy Luoma wrote:
>
> There are a lot of Apple-specific utilities that I'm not familiar  
> with.  I'm trying to figure out if there is a way to do this w/o  
> using 'system_profiler' which is fairly CPU intensive.

Here are a few options.
1) Use a datatype with system_profiler:
`system_profiler SPFireWireDataType`, then grep what you need out.  
This is only available on 10.3 and higher, IIRC.

2) diskutil
If the name of the external drive will never change, or you only  
expect to have one drive attached at any given time, try using  
`diskutil list`. This will return a list of all drives and  
partitions, which you can also use grep on.

Hope this helps,

-- 
Chris Garaffa
chris at nilzero.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.themacintoshguy.com/pipermail/x-unix/attachments/20050905/20add2d8/attachment.html


More information about the X-Unix mailing list