Re: Grabing Disk Information
Re: Grabing Disk Information
- Subject: Re: Grabing Disk Information
- From: Bob Ippolito <email@hidden>
- Date: Wed, 28 Apr 2004 19:28:38 -0400
On Apr 28, 2004, at 6:21 PM, Jay Vaughan wrote:
I was wondering the way to grab all the Hard Drives infos.
execvp("/bin/sh", "/bin/ls -C1 /dev/disk* | /usr/bin/xargs -L 1
/usr/sbin/diskutil info");
oops, sorry, forgot this was a cocoa list. never mind any of that
malarkey...
i have no foggy clue, whatsoever, how to do disk arbitration like that
in Cocoa, (i guess you're "not supposed to", at that level of things)
but i would nevertheless like to point out that you've still got -all-
the unix'ish stuff available to you, in OSX, to do file/disk
operations. if you ever get stuck, but can get the details from the
command line, then you've at least got trusty ol' execvp() and co' to
help you move things along ... and i bet you a nickel you can wrap a
shell-escape/pipe situation into some snarfy Cocoa string-class or
two, to give you what you need to stay in Objektiv-Z land ...
This way is extremely slow, and doesn't give you updates when the list
changes.. It's good for a quick hack, but not something I'd put
anywhere near a real application.
-bob
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.