Filesys-Virtual-Async-inMemory
view release on metacpan or search on metacpan
there are some areas that needs mentioning.
root
Unimplemented, No sense in changing the root during run-time...
stat
Array mode not supported because it would require extra munging on my
part to get the paths right.
link/symlink/lstat
Links are not supported at this time because of the complexity involved.
readahead/fsync/fdatasync
Always returns success ( 0 ), because they are useless to us
Subclassing this module
If you want to subclass this module, please read on! The primary reason
for subclassing is so you have true "callbacks" whenever the API is
called, instead of providing a static filesystem structure. This module
tries to do it's best to reduce the pain, but you would need to be aware
of some things.
The way this module implements subclassing is to call a private method
whenever it detects a subclass using this module as a superclass. Please
don't override the ::Async API! What you need to do is define your own
_method subs for the ones you want to override. All other methods that
aren't defined will return ENOSYS to the ::Async API.
Available methods to implement: _rmtree, _scandir, _move, _copy, _load,
_readdir, _rmdir, _mkdir, _rename, _mknod, _unlink, _chmod, _truncate,
_chown, _utime, _stat, _write, _open.
Again, please look at the source for this module to see how it interacts
with the subclass. Some of the methods have been "simplified" to reduce
the pain of managing the data. Be sure to let this module create the
object, because we need the "readonly" attribute to be present in the
hash! If "readonly" is set, this module will take over the logic for
certain methods and not call your method if there's a readonly violation
( write(), for example ).
Debugging
You can enable debug mode which prints out some information ( and
especially error messages ) by doing this:
sub Filesys::Virtual::Async::inMemory::DEBUG () { 1 }
use Filesys::Virtual::Async::inMemory;
TODO
* automatically overriding CORE::* methods
#poe@magnet
<buu> Apocalypse: Hey, while you're at it, can you make it so all file access operators in perl operate on virtual directories?
<Apocalypse> buu: hm you mean overriding readdir(), stat()?
<buu> Yes.
<Apocalypse> as of now you would have to explicitly use the filesys::virtual::async::inmemory object and do operations on it -> $fsv->readdir(), $fsv->open(), etc
<buu> But I don't want to!
<buu> =]
<Apocalypse> but that would be a fun side project to try and figure out how to hijack CORE:: stuff
<buu> Yes!
<Apocalypse> hmm you could locally scope the hijack, pass a $fsv object to the module init, and have it transparently replace all file operations in the scope with $fsv->method calls
<Apocalypse> why would you want it? pure laziness? haha
<buu> Apocalypse: For buubot..
<Apocalypse> mmm for now you can just use fsv::inmemory until somebody with enough wizardry does the overrides :)
<Apocalypse> I'll file that away in my TODO and see if I will return to it someday hah
<buu> Exccelent.
SEE ALSO
Filesys::Virtual::Async
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Filesys::Virtual::Async::inMemory
Websites
* Search CPAN
<http://search.cpan.org/dist/Filesys-Virtual-Async-inMemory>
* AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/Filesys-Virtual-Async-inMemory>
* CPAN Ratings
<http://cpanratings.perl.org/d/Filesys-Virtual-Async-inMemory>
* CPAN Forum
<http://cpanforum.com/dist/Filesys-Virtual-Async-inMemory>
* RT: CPAN's Request Tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Filesys-Virtual-Async-inMe
mory>
* CPANTS Kwalitee
<http://cpants.perl.org/dist/overview/Filesys-Virtual-Async-inMemory
>
* CPAN Testers Results
<http://cpantesters.org/distro/F/Filesys-Virtual-Async-inMemory.html
>
* CPAN Testers Matrix
<http://matrix.cpantesters.org/?dist=Filesys-Virtual-Async-inMemory>
* Git Source Code Repository
This code is currently hosted on github.com under the account
"apocalypse". Please feel free to browse it and pull from it, or
whatever. If you want to contribute patches, please send me a diff
or prod me to pull from your repository :)
<http://github.com/apocalypse/perl-filesys-virtual-async-inmemory>
Bugs
( run in 0.469 second using v1.01-cache-2.11-cpan-39bf76dae61 )