[Adium-devl] Let's abandon disk images

Peter Hosey boredzo at gmail.com
Sat Apr 7 03:20:09 UTC 2007


On Apr 06, 2007, at 13:45:53, David Smith wrote:
> Go go #macsb: http://paste.lisp.org/display/39335

There's a better way.

Step 1 is the abandonment of getmntinfo—static storage considered  
harmful. If we go that way at all, then we should use getfsstat  
instead, which has us provide the storage.

Step 2 is the replacement of getfsstat, which gives us info on *all*  
devices, with statfs, which gives us info on one mount point (or any  
file thereon). It's the POSIX equivalent of -[NSFileManager  
fileSystemAttributesAtPath:], except that it gives a lot more info.

There's also a way to do it that involves - 
fileSystemAttributesAtPath:. Among the crumbs of information  
(relative to statfs) that it provides is the device number (dev_t).  
You can pass this to devname_r to get the filename of the device. The  
difference is that statfs gives “/dev/foo” whereas devname_r gives  
just “foo”. This is more roundabout than simply calling statfs, though.

I do thank Gus, though, for providing that section of FMKit, which  
started me on the above research. :)

Doc links in order of mention:

x-man-page://getmntinfo
x-man-page://getfsstat
x-man-page://statfs
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ 
Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/ 
instm/NSFileManager/fileSystemAttributesAtPath:>
x-man-page://devname_r
___________________________________
\ Peter Hosey / boredzo at adiumx.com
PGP public key ID: C6550423 (since 2007-01-01)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070406/184ba603/attachment.sig>


More information about the devel mailing list