10 strix.pl - mount Strix database as filesystem
14 strix.pl database /mnt
18 With this script, you can utilize C<Fuse> and C<Fuse::DBI> modules to mount
19 content from Strix - knowledge owl portal and edit them using command-line
20 utilities (like C<vi> or C<ftp>).
24 my ($database,$mount) = @ARGV;
26 unless ($database && $mount) {
27 print STDERR <<_USAGE_;
28 usage: $0 database /mnt
30 For more information see perldoc $0
35 system "fusermount -u $mount" unless (-w $mount);
38 print STDERR "Current user doesn't have permission on mount point $mount: $!";
46 replace(getpathfromnav(multistatic_navigation.kategorija_id)||' > '||getpathfromms(multistatic_navigation.multistatic_id),' > ','/')||'.html' as filename,
48 length(content) as size,
50 from multistatic_navigation,multistatic
51 where multistatic.id = multistatic_id and
52 not multistatic_navigation.redirect;
66 my $dsn = 'DBI:Pg:dbname='.$database;
69 print "using database '$dsn', mountpoint $mount\n";
71 my $mnt = Fuse::DBI->mount({
72 filenames => $sql->{'filenames'},
73 read => $sql->{'read'},
74 update => $sql->{'update'},
81 # print STDERR "invalidating content in $template_dir\n";
82 # opendir(DIR, $template_dir) || die "can't opendir $template_dir: $!";
83 # map { unlink "$template_dir/$_" || warn "can't remove $template_dir/$_: $!" } grep { !/^\./ && -f "$template_dir/$_" } readdir(DIR);
89 print STDERR "can't mount filesystem!";
93 print "Press enter to exit...";
101 L<http://www.rot13.org/~dpavlin/fuse_dbi.html>
103 C<FUSE (Filesystem in USErspace)> website
104 L<http://fuse.sourceforge.net/>
108 Dobrica Pavlinusic, E<lt>dpavlin@rot13.orgE<gt>
110 =head1 COPYRIGHT AND LICENSE
112 Copyright (C) 2004 by Dobrica Pavlinusic
114 This library is free software; you can redistribute it and/or modify
115 it under the same terms as Perl itself, either Perl version 5.8.4 or,
116 at your option, any later version of Perl 5 you may have available.