in reply to What would you like to see in a Virtual Filesystem for Perl?

I'm toying with Filesystem-like systems and the one thing I'd really like is a better abstraction for File::Find / File::Find::Rule. Especially being able to formulate queries as SQL is a very nice thing that allows interesting queries that would have to be programmed otherwise. Having queries for the file content is another interesting thing but might go too far. Adding content-queries is just a single attribute in the query language anyway.

Another thing is being able to nest VFSes, so that I can treat archives as directories, and I can access files over ssh / sftp, and I can also access archives as directories via ssh.

My two attempts at this live at FFRIndexed and Filesys::DB.

Replies are listed 'Best First'.
Re^2: What would you like to see in a Virtual Filesystem for Perl?
by NERDVANA (Priest) on Aug 22, 2023 at 19:20 UTC
    I'm all in favor of adding lots of shortcuts to other modules, like how Path::Class does for File::Temp and so on.

    The first idea I get from looking at your modules would be something like making DBIC resultsets out of file trees, like

    $fileSet= $path->find( name => qr/.../, size => '>=4000', dir_filter => sub($d) { ... }, ); # Throws an exception unless MIME::Detect is installed $fileSet= $fileSet->find(mime_type => 'text/plain'); my $iter= $fileSet->iter; # depth-first, unless parameter "bfs" given while (&$iter) { ... } # if the list is known to be small my @files= $fileSet->all;
    Then your module could adapt those into a SQL query and cache a directory tree, and then use the same path objects to query that database.