Re: NSOpenPanel & NSFileTypeForHFSTypeCode
Re: NSOpenPanel & NSFileTypeForHFSTypeCode
- Subject: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
- From: Steve Checkoway <email@hidden>
- Date: Thu, 11 Oct 2007 06:30:59 -0700
On Oct 11, 2007, at 4:51 AM, Chris Heimark wrote:
You're right about 'diskutil' output suddenly being un-parsable with
any or all software update. It is also an issue having an 'open'
shell script as a hackable entity in the resources bundle - making
my intent of limiting volumes accessed to flash drives completely
vulnerable.
Your script didn't work for me. It didn't identify either of my
drives, probably related to spaces in the name? Also, diskutil isn't
giving me any uuid info for the two drives.
I'll try your getfsstat() code to see if that might not be the right
approach for this application - though I do need to get at the UUID
as well - so maybe I'll have to use the IORegistry as well.
For one thing, doing it in code is quite a bit faster.
[dualg5:~/temp] steve$ time ./a.out
/Volumes/Secure II
/Volumes/NO NAME
real 0m0.099s
user 0m0.004s
sys 0m0.059s
[dualg5:~/temp] steve$ time sh disks.sh
UNQUALIFIED: /Volumes/MacDjView
UNQUALIFIED: /Volumes/New
UNQUALIFIED: /Volumes/w00t
real 0m9.869s
user 0m2.001s
sys 0m1.667s
(Yes, my hard drive is really called w00t.)
What is the accepted Cocoa interface to the IORegistry or am I
limited to lower level calls for that as well?
I don't believe there to be one, but it probably wouldn't be that hard
to write a wrapper if one _really_ wanted. You just have to read the
documentation and call the appropriate release functions for the
various objects when you are finished with them: CFRelease for core
foundation objects (making sure you follow the create/get rule) and
IOObjectRelease for the various IOKit objects.
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden