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 id||'-'||title||'.html' as filename,
47 length(content) as size,
63 my $dsn = 'DBI:Pg:dbname='.$database;
66 print "using database '$dsn', mountpoint $mount\n";
68 my $mnt = Fuse::DBI->mount({
69 filenames => $sql->{'filenames'},
70 read => $sql->{'read'},
71 update => $sql->{'update'},
78 # print STDERR "invalidating content in $template_dir\n";
79 # opendir(DIR, $template_dir) || die "can't opendir $template_dir: $!";
80 # map { unlink "$template_dir/$_" || warn "can't remove $template_dir/$_: $!" } grep { !/^\./ && -f "$template_dir/$_" } readdir(DIR);
86 print STDERR "can't mount filesystem!";
90 print "Press enter to exit...";
98 L<http://www.rot13.org/~dpavlin/fuse_dbi.html>
100 C<FUSE (Filesystem in USErspace)> website
101 L<http://fuse.sourceforge.net/>
105 Dobrica Pavlinusic, E<lt>dpavlin@rot13.orgE<gt>
107 =head1 COPYRIGHT AND LICENSE
109 Copyright (C) 2004 by Dobrica Pavlinusic
111 This library is free software; you can redistribute it and/or modify
112 it under the same terms as Perl itself, either Perl version 5.8.4 or,
113 at your option, any later version of Perl 5 you may have available.