Skip Menu |

This queue is for tickets about the Sys-Filesystem CPAN distribution.

Report information
The Basics
Id: 7958
Status: resolved
Priority: 0/
Queue: Sys-Filesystem

People
Owner: nicolaw [...] cpan.org
Requestors: schwern [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.11
Fixed in: (no value)



Subject: It don't work on OS X
Trying to install Sys::Filesystem on OS X 10.3.5 it complains it can't find Sys::Filesystem::Darwin. I would have thought it would fall back to Unix. PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01test....Can't locate Sys/Filesystem/Darwin.pm in @INC (@INC contains: ./lib ../lib /private/var/local/cpanplus/5.8.1/build/Sys-Filesystem-1.11/blib/lib /private/var/local/cpanplus/5.8.1/build/Sys-Filesystem-1.11/blib/arch /sw/lib/perl5/5.8.1/darwin-thread-multi-2level /sw/lib/perl5/5.8.1 /sw/lib/perl5 /sw/lib/perl5/darwin /System/Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 /Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level /Network/Library/Perl/5.8.1 /Network/Library/Perl .) at (eval 4) line 1. Sys::Filesystem::new('Sys::Filesystem') called at t/01test.t line 7 # Failed test (t/01test.t at line 9) # Failed test (t/01test.t at line 10) # Failed test (t/01test.t at line 11) # Failed test (t/01test.t at line 12) # Failed test (t/01test.t at line 14) # Looks like you failed 5 tests of 6. dubious Test returned status 5 (wstat 1280, 0x500) DIED. FAILED tests 2-6 Failed 5/6 tests, 16.67% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/01test.t 5 1280 6 5 83.33% 2-6 Failed 1/1 test scripts, 0.00% okay. 5/6 subtests failed, 16.67% okay.
[MSCHWERN - Mon Oct 11 14:41:49 2004]: Show quoted text
> Trying to install Sys::Filesystem on OS X 10.3.5 it complains it
can't Show quoted text
> find Sys::Filesystem::Darwin. I would have thought it would fall > back to Unix.
Indeed so would I! What version is it you're working with, (I assume 1.11, latest as per CPAN)? 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. In the mean time I'll look in to why it didn't fail over to Unix.
[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
Things are looking better with 1.15. 0 /usr/local/src/CPAN/Sys-Filesystem-1.14$ perl -Ilib -w t/01test.t ok 1 - Create new Sys::Filesystem object ok 2 - Get list of mounted filesystems not ok 3 - Get list of unmounted filesystems # Failed test (t/01test.t at line 13) not ok 4 - Get list of special filesystems # Failed test (t/01test.t at line 14) not ok 5 - Get list of regular filesystems # Failed test (t/01test.t at line 15) ok 6 - Get list of all filesystems ok 7 - Get device for / not ok 8 - Get options for / # Failed test (t/01test.t at line 20) ok 9 - Get type for / ok 10 - Get volume type for / ok 11 - Get label for / ok 12 - Get filesystem attached to disk0s3 1..12 # Looks like you failed 4 tests of 12. Of those failures the "unmounted filesystem" failure seems bogus. I don't really know what an "unmounted filesystem" would be or why I'd have one. mounted_filesystems() and filesystems() both properly detect my one mounted regular filesystem / but regular_filesystems() fails to spot it. This patch fixes the problem: --- Filesystem.pm 2005/07/06 18:32:20 1.1 +++ Filesystem.pm 2005/07/06 18:41:14 @@ -146,7 +146,7 @@ sub regular_filesystems { my $self = shift; - return $self->filesystems(special => undef); + return $self->filesystems(special => 0); } sub DESTROY {} though it might break other filesystems. Frankly I think splitting hairs between undef, false and doesn't exist is unnecessarily fragile. Sys::Filesystem::Darwin doesn't try to detect any of the mount options but I'm not really sure how to even do that by hand. The three mounted special filesystems: devfs, fdesc and <volfs> are all missed. 0 ~$ df -T Filesystem Type 1k-blocks Used Available Use% Mounted on /dev/disk0s3 hfs 38938968 38327196 355772 100% / devfs devfs 1 1 0 100% /dev fdesc fdesc 1 1 0 100% /dev <volfs> volfs 512 512 0 100% /.vol
[MSCHWERN - Wed Jul 6 14:45:22 2005]: Show quoted text
> Things are looking better with 1.15.
Umm, 1.14.
Should be fixed now