[NICOLAW - Tue Oct 12 02:42:32 2004]:
Show quoted text> Indeed so would I! What version is it you're working with, (I assume
> 1.11, latest as per CPAN)?
Yes, 1.11.
Show quoted text> I don't have a Darwin box, so if you'd be able to mail me the man
> pages for mnttab and fstab/vfstab or whatever is used on Darwins
> BSDesque like design, and copies of those files on your system I shall
> whip up a Darwin module.
While /etc/fstab exists it does not appear to be functional, it looks
like a commented out stub. /etc/xtab is empty. The rest don't exist.
The *tab man pages are your standard BSD manuals and don't shed any
light on the subject.
http://www.osxfaq.com/MAN/Index/A.ws has the man
pages. "Mac OS X Panther for Unix Geeks" doesn't seem to help either.
I believe /etc/fstab is only used if you want to hard wire a mount at
startup. Otherwise everything is automounted. A lot of the /etc files
exist but aren't used. The mount information is not available in
NetInfo though. Hmmm. I don't know where OS X stores its currently
mounted filesystems. Maybe its only in memory.
Command line utilities like mount and df mercifully work as expected.
Show quoted text> In the mean time I'll look in to why it didn't fail over to Unix.
Going through in the debugger... it is falling back to Unix. The "can't
find Darwin" message is just a warning (it should probably fallback
quietly). A Unix object gets created for $self->{filesystems}, ok. And
since all the *stab files are empty it doesn't find any mounted
filesystems so everything after the first test fails.
For Unixy systems you might be better off just parsing the output of
mount and df -T. They better reflect the current mounts rather than
just what's available on startup and I'm willing to bet there's less
variety in those utilities than the format of the *tab files.
Or perhaps call getfsstat(), that should work for BSD systems.
Here's the output of mount on my laptop with just one mounted hard drive:
$ mount
/dev/disk0s3 on / (local, journaled)
devfs on /dev (local)
fdesc on /dev (union)
<volfs> on /.vol
automount -nsl [390] on /Network (automounted)
automount -fstab [396] on /automount/Servers (automounted)
automount -static [396] on /automount/static (automounted)
Here's the BSD df that comes with the OS
$ /bin/df
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/disk0s3 77877936 55164792 22201144 71% /
devfs 176 176 0 100% /dev
fdesc 2 2 0 100% /dev
<volfs> 1024 1024 0 100% /.vol
automount -nsl [390] 0 0 0 100% /Network
automount -fstab [396] 0 0 0 100%
/automount/Servers
automount -static [396] 0 0 0 100%
/automount/static
And GNU df which I installed later.
$ df -Ta
Filesystem Type 1k-blocks Used Available Use% Mounted on
/dev/disk0s3 hfs 38938968 27582400 11100568 72% /
devfs devfs 1 1 0 100% /dev
fdesc fdesc 1 1 0 100% /dev
<volfs> volfs 512 512 0 100% /.vol
automount -nsl [390]
nfs 0 0 0 - /Network
automount -fstab [396]
nfs 0 0 0 - /automount/Servers
automount -static [396]
nfs 0 0 0 - /automount/static
And to top off all the confusion, here's what the partition map of my
laptop's drive looks like (from pdisk).
Name of device: /dev/disk0
/dev/disk0 map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_Free 0+@ 64
3: Apple_HFS Untitled 77877942 @ 262208 ( 37.1G)
4: Apple_Free 0+@ 78140150
Device block size=512, Number of Blocks=78140160
DeviceType=0x0, DeviceId=0x0
Think of it like a logical disk parition, except with extra cleverness.
Yes, those empty partitions are supposed to be there.
http://developer.apple.com/technotes/tn/tn1150.html#Summary