This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /perl-llin/test/statfs.t

Parent Directory Parent Directory | Revision Log Revision Log

Revision 112 - (show annotations)
Thu Nov 15 09:32:08 2007 UTC (15 years ago) by dpavlin
File MIME type: application/x-troff
File size: 712 byte(s)
patch from Chris Dolan via rt.cpan.org #30631

This patch gets Fuse.pm to half-work on MacOSX with the current release
of MacFuse (v1.1.0).  By half-work, I mean that all of the directory
actions and file read actions work, but anything that involves writing a
file fails.  This appears to be because the latest MacFUSE implements
FUSE 2.6, which prefers to call CREATE instead of MKNOD.  Nonetheless,
recommend that something like this patch be included because it makes
read-only filesystems usable on Darwin systems.  Some of my changes
(like kill() instead of system("kill")) are improvements on any system.
												    I've tested only on my PowerPC G5 iMac running 10.4.

I intend to also try MacFUSE v0.4 via Fink, but that version is                                     
reportedly less stable than the latest MacFUSE.                                                     
1 #!/usr/bin/perl
2 use test::helper qw($_real $_point);
3 use Test::More;
4 eval {
5 require 'syscall.ph'; # for SYS_statfs
6 } or plan skip_all => 'No syscall.ph';
8 plan tests => 7;
9 my ($statfs_data) = 0x00 x 8 x 16;
10 my ($tmp) = $_point;
11 ok(!syscall(&SYS_statfs,$tmp,$statfs_data),"statfs");
12 # FIXME: this is soooooo linux-centric. perhaps parse the output of /bin/df?
13 my @list = unpack("L!7L2L!7",$statfs_data);
14 diag "statfs: ",join(', ', @list);
15 shift(@list);
16 is(shift(@list),4096,"block size");
17 is(shift(@list),1000000,"blocks");
18 is(shift(@list),500000,"blocks free");
19 shift(@list);
20 is(shift(@list),1000000,"files");
21 is(shift(@list),500000,"files free");
22 shift(@list);
23 shift(@list);
24 is(shift(@list),255,"namelen");

  ViewVC Help
Powered by ViewVC 1.1.26