Im sure we shall soon see a flood of apps which enable disable journalling on a given volume. Im developing one of them. The part im kinda stuck on right now, is determining the state of journalling. Presently I have found two ways, both of which kinda suck.
1) NSTask with "mount"
lots of parsing required to beat the output into anything usefull. gotta break up the output into an array of lines, then compare each of those lines with an array that is made from :
[[NSWorkspace sharedWorkspace] mountedLocalVolumePaths]
minus
[[NSWorkspace sharedWorkspace] mountedRemovableMedia]
only then, can I associate the info from "mount" with a volume capable of being journalled.
2) NSTask with diskutil info <pathToVolume>
this is more straight forward, but really really slow. at least on my box, it takes 28 seconds to enumerate thru the strings of paths with an NSTask for each one. I have four drives where journalling is possible. So thats like 7 seconds for each loop of NSTask with the volume path. Also as an aside, when I run diskutil info <pathToVolume>, i get this everytime before the good stuff. Is this normal? Heres my terminal output:
[beardedllama:~] xaos01% diskutil info /
Couldn't open device /dev/rdisk2
Couldn't open device /dev/rdisk3
Couldn't open device /dev/rdisk3
Couldn't open device /dev/rdisk3
Couldn't open device /dev/rdisk3
Couldn't open device /dev/rdisk2
Couldn't open device /dev/rdisk2
Couldn't open device /dev/rdisk2
Timed out waiting for arbitration
Device Node: /dev/disk1s9
Device Identifier: disk1s9
Mount Point: /
Volume Name: MOBIUS
File System: HFS+
Partition Type: Apple_HFS
Media Type: Generic
Protocol: ATA
Total Size: 23.0 GB
Free Space: 480.1 MB
Read Only: No
Ejectable: No
So how do you guys think I should go about determining if journalling is enabled on a given volume? Is there some carbon (may as well be cunniform to me) way to do it? Anyone benevolent cocoaGods feel like writting a method like:
- (BOOL) journalStateOfVolume:(NSString *)thePath;