• 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: Grabing Disk Information
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Grabing Disk Information (From: "Matthew Jaffa" <email@hidden>)
 >Re: Grabing Disk Information (From: Jay Vaughan <email@hidden>)

  • Prev by Date: Re: Solved [Q] Why unsolicited dealloc in NSKeyedUnarchiver?
  • Next by Date: WebKit and runModalForWindow not a good mix?
  • Previous by thread: Re: Grabing Disk Information
  • Next by thread: Re[2]: Grabing Disk Information
  • Index(es):
    • Date
    • Thread