VFSsimple::Base
A based module for any VFSimple driver.
package VFSsimple::Drv::Any; use base qw(VFSsimple::Base); use File::Copy; our $VERSION = '0.01'; sub drv_new { my ($self) = @_; ... return $self; } sub drv_get { my ($self, $src) = @_; return $self->{realroot} . '/' . $src; } sub drv_copy { my ($self, $src, $dest) = @_; return File::Copy::copy($self->{realroot} . '/' . $src, $dest) ? $dest : (); } 1;
Store last error message
Return the root url of the VFS
If VFS handle a tree inside an archive, return the path of this archive.
If VFS handle a tree inside an archive, return the virtual root path inside the archive.
This function is called during object creation (new). It receive as arguments the fresh blessed object and allow the driver to load data it will need to work.
Should return the object in case of success, nothing on error.
This function should copy $source relative path from vfs to $dest local path.
Should return True on success.
Should return any file path where the file can be locally found, nothing on error.
If this function is not provided, a default from VFSimple::Base is provided generating a temporary file and using drv_copy() to fetch it.
Should return a read only file handle for relative path $src.
If the function is not provide, default return an open file handle over a deleted temp file using drv_copy to fetch the file.
Should true if $file exists
VFSimple
(c) 2006, 2007 Olivier Thauvin <nanardon@nanardon.zarb.org>
/* This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar 14 rue de Plaisance, 75014 Paris, France Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.
To install VFSsimple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VFSsimple
CPAN shell
perl -MCPAN -e shell install VFSsimple
For more information on module installation, please visit the detailed CPAN module installation guide.