Subject: | big (more than 2G) files |
Date: | Sat, 8 Mar 2008 08:42:59 +0100 |
To: | bug-Fuse [...] rt.cpan.org |
From: | "Morten Guldager" <morten.guldager [...] gmail.com> |
'Aloha!
Seems that Fuse's "getattr" call can't return a file size higher than 2G
(2^31)
Tested with:
- Fuse-0.6 and Fuse-0.8
- Kubuntu Linux, kernel 2.6.22-14-generic
- perl v5.8.8
The provided loopback.pl program shows it as well as my own application.
SImple demo provided here:
<code>
#!/usr/bin/perl
use strict;
use warnings;
use Fuse;
# unmount with: fusermount -u /tmp/fuse-test-mount
Fuse::main(mountpoint => '/tmp/fuse-test-mount',
getattr => \&getattr,
getdir => \&getdir);
sub getattr
{
my ($p) = @_;
return qw( 0 1 16877 0 0 0 0 0 0 0 0 0 0 ) if $p eq '/';
my $size = 3000000000; # 3G
return 0, 2, 33261, 0, 0, 0, 0, $size, 0, 0, 0, 0, 0;
}
sub getdir
{
return "This-is-a-big-file", 0;
}
</code>
$ ls -l /tmp/fuse-test-mount/
total 0
-rwxr-xr-x 0 root root 18446744072414584320 1970-01-01 00:00
This-is-a-big-file
--
/Morten %-)