/[fuse_dbi]/fuse-couchdb/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 /fuse-couchdb/DBI.pm

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

revision 21 by dpavlin, Sat Oct 2 15:29:02 2004 UTC revision 23 by dpavlin, Sat Oct 2 16:54:42 2004 UTC
# Line 24  Fuse::DBI - mount your database as files Line 24  Fuse::DBI - mount your database as files
24    use Fuse::DBI;    use Fuse::DBI;
25    Fuse::DBI->mount( ... );    Fuse::DBI->mount( ... );
26    
27  See L<run> below for examples how to set parametars.  See C<run> below for examples how to set parametars.
28    
29  =head1 DESCRIPTION  =head1 DESCRIPTION
30    
31  This module will use L<Fuse> module, part of C<FUSE (Filesystem in USErspace)>  This module will use C<Fuse> module, part of C<FUSE (Filesystem in USErspace)>
32  available at L<http://sourceforge.net/projects/avf> to mount  available at L<http://sourceforge.net/projects/avf> to mount
33  your database as file system.  your database as file system.
34    
# Line 85  sub mount { Line 85  sub mount {
85    
86          $ctime_start = time();          $ctime_start = time();
87    
88            my $pid;
89          if ($arg->{'fork'}) {          if ($arg->{'fork'}) {
90                  my $pid = fork();                  $pid = fork();
91                  die "fork() failed: $!" unless defined $pid;                  die "fork() failed: $!" unless defined $pid;
92                  # child will return to caller                  # child will return to caller
93                  if ($pid) {                  if ($pid) {
94                          $self ? return $self : return undef;                          return $self;
95                  }                  }
96          }          }
97    
# Line 103  sub mount { Line 104  sub mount {
104    
105          $self->read_filenames;          $self->read_filenames;
106    
107          my $mount = Fuse::main(          Fuse::main(
108                  mountpoint=>$arg->{'mount'},                  mountpoint=>$arg->{'mount'},
109                  getattr=>\&e_getattr,                  getattr=>\&e_getattr,
110                  getdir=>\&e_getdir,                  getdir=>\&e_getdir,
# Line 117  sub mount { Line 118  sub mount {
118                  debug=>0,                  debug=>0,
119          );          );
120    
121          if (! $mount) {          exit(0) if ($arg->{'fork'});
122                  warn "mount on ",$arg->{'mount'}," failed!\n";  
123                  return undef;          return 1;
124          }  
125  };  };
126    
127  =head2 umount  =head2 umount

Legend:
Removed from v.21  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26