Submitted by OneOfOne on Mon, 17/01/2005 - 21:37.
( categories: Programming )
Well I was bored and wanted to learn perl then I noticed the sweet fuse while working on 2.6.11-rc1-love1 and it hit me, let's make a mysql filesystem!
Here's my first take at it, it works 100% read-only, of course its not multithreaded (my 2nd perl script ever..) so don't abuse it too much :-p
url : http://www.q2h.com/gentoo/sqlfs-fuse.pl
Depends on:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/fuse login
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/fuse co perl
cd perl; perl Makefile.PL; make install
perl sqlfs-fuse.pl /tmp/fuse-test -d database -u database-user [-p password] [-h database-host defaults to localhost]
Usage: sqlfs-fuse.pl [mountpoint] --database|-d database-name
[--hostname|-h database-host]
[--username|-u username]
[--password|-p password]
[--sql-backend mysql|mssql|pgsql]
any comments, recommendations, etc are always welcome.
--example--
[~/programming/perl] -> perl sqlfs-fuse.pl /tmp/fuse-test -d portage -u portage ; umount /tmp/fuse-test
e_getattr (/);
e_getattr (/);
---switch to another term--
[~] -> ls /tmp/fuse-test
category_table/ items_table/ package_name/ path_table/
[~] -> ls /tmp/fuse-test/path_table/
0/ 1/
[~] -> ls /tmp/fuse-test/path_table/0
name p_id
[~] -> cat /tmp/fuse-test/path_table/0/*
/var/cache/edb/dep/usr/local/portage
5
Why i made it? for fun and learning.
Love-sources : http://love-sources.q2h.com http://www.love-sources.org #love-sources on irc.freenode.net
peace

Get GNU / Linux
News Feed
Blogs
Event Photos
Screen Shots
Polls
Popular Content
Members
Search
Wall Papers