/[fuse_dbi]/trunk/DBI.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/DBI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 30 by dpavlin, Sat Oct 9 00:03:42 2004 UTC revision 32 by dpavlin, Mon Nov 15 20:45:03 2004 UTC
# Line 342  sub e_getdir { Line 342  sub e_getdir {
342          my %out;          my %out;
343          foreach my $f (sort keys %files) {          foreach my $f (sort keys %files) {
344                  if ($dirname) {                  if ($dirname) {
345                          if ($f =~ s/^\E$dirname\Q\///) {                          if ($f =~ s/^\Q$dirname\E\///) {
346                                  $out{$f}++ if ($f =~ /^[^\/]+$/);                                  $out{$f}++ if ($f =~ /^[^\/]+$/);
347                          }                          }
348                  } else {                  } else {
# Line 364  sub read_content { Line 364  sub read_content {
364    
365          $sth->{'read'}->execute($id) || die $sth->{'read'}->errstr;          $sth->{'read'}->execute($id) || die $sth->{'read'}->errstr;
366          $files{$file}{cont} = $sth->{'read'}->fetchrow_array;          $files{$file}{cont} = $sth->{'read'}->fetchrow_array;
367          $files{$file}{ctime} = time();          # I should modify ctime only if content in database changed
368            #$files{$file}{ctime} = time() unless ($files{$file}{ctime});
369          print "file '$file' content [",length($files{$file}{cont})," bytes] read in cache\n";          print "file '$file' content [",length($files{$file}{cont})," bytes] read in cache\n";
370  }  }
371    
# Line 410  sub clear_cont { Line 411  sub clear_cont {
411          print "invalidate all cached content\n";          print "invalidate all cached content\n";
412          foreach my $f (keys %files) {          foreach my $f (keys %files) {
413                  delete $files{$f}{cont};                  delete $files{$f}{cont};
414                    delete $files{$f}{ctime};
415          }          }
416          print "begin new transaction\n";          print "begin new transaction\n";
417          #$dbh->begin_work || die $dbh->errstr;          #$dbh->begin_work || die $dbh->errstr;

Legend:
Removed from v.30  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26