Eyck has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed monks,

I'm looking for a way to provide my scripts with virtual filesystem, ie, I would like to catch all the access to, for example '/myfs/'.

open($fd,"/myfs/file.1");

This can be done on OS-level, but that would be system-wide, not script-wide, OSes like HURD provide you with similar facilities, you can also trick app with dynamic-library overloading tricks, but I'm looking for something on perl-level (if it's at all doable).

I do understand that any perl-based solution would be invisible to some non-pure-perl modules, but it should still be usefull.

Is there anything like that outthere? (or maybe is it at all doable?)

UPDATE

I wonder why I haven't got any meaningfull replies, maybe the task in undoable in perl, or maybe I just phrased it badly... very badly.

Replies are listed 'Best First'.
Re: Virtual Filesystem,
by marto (Cardinal) on Jun 08, 2005 at 10:53 UTC
    Hi,

    Have you had a look at Filesys::Virtual?
    "Perl extension to provide a framework for a virtual filesystem".

    Hope this helps,

    Cheers,

    Martin
      The source is there but every method is unimplemented :)
Re: Virtual Filesystem,
by svpv (Acolyte) on Jun 08, 2005 at 14:09 UTC
    http://oss.sgi.com/projects/fam/ fam, the File Alteration Monitor, provides a daemon and an API which applications can use to be notified when specific files or directories are changed.
Re: Virtual Filesystem,
by svpv (Acolyte) on Jun 08, 2005 at 14:11 UTC
    http://search.cpan.org/dist/SGI-FAM/