--- trunk/DBI.pm 2004/11/28 20:20:36 53 +++ trunk/DBI.pm 2005/04/26 20:12:55 55 @@ -12,7 +12,7 @@ use Carp; use Data::Dumper; -our $VERSION = '0.07'; +our $VERSION = '0.08'; # block size for this filesystem use constant BLOCK => 1024; @@ -329,12 +329,14 @@ # read them in with sesible defaults while (my $row = $sth->{'filenames'}->fetchrow_hashref() ) { + $row->{'filename'} ||= 'NULL-'.$row->{'id'}; $files{$row->{'filename'}} = { size => $row->{'size'}, mode => $row->{'writable'} ? 0644 : 0444, id => $row->{'id'} || 99, }; + my $d; foreach (split(m!/!, $row->{'filename'})) { # first, entry is assumed to be file @@ -373,7 +375,7 @@ $file =~ s,^/,,; $file = '.' unless length($file); return -ENOENT() unless exists($files{$file}); - my ($size) = $files{$file}{size} || BLOCK; + my ($size) = $files{$file}{size} || 0; my ($dev, $ino, $rdev, $blocks, $gid, $uid, $nlink, $blksize) = (0,0,0,int(($size+BLOCK-1)/BLOCK),0,0,1,BLOCK); my ($atime, $ctime, $mtime); $atime = $ctime = $mtime = $files{$file}{ctime} || $ctime_start; @@ -432,6 +434,7 @@ read_content($file,$files{$file}{id}) unless exists($files{$file}{cont}); + $files{$file}{cont} ||= ''; print "open '$file' ",length($files{$file}{cont})," bytes\n"; return 0; }