/[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 28 by dpavlin, Fri Oct 8 23:43:06 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;
# Line 524  C<FUSE (Filesystem in USErspace)> websit Line 526  C<FUSE (Filesystem in USErspace)> websit
526  L<http://sourceforge.net/projects/avf>  L<http://sourceforge.net/projects/avf>
527    
528  Example for WebGUI which comes with this distribution in  Example for WebGUI which comes with this distribution in
529  directory L<examples/webgui.pl>. It also contains a lot of documentation  directory C<examples/webgui.pl>. It also contains a lot of documentation
530  about design of this module, usage and limitations.  about design of this module, usage and limitations.
531    
532  =head1 AUTHOR  =head1 AUTHOR

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

  ViewVC Help
Powered by ViewVC 1.1.26