Olivier Thauvin > VFSsimple > VFSsimple

Download:
VFSsimple/VFSsimple-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

VFSsimple

DESCRIPTION ^

A library to magically access to file w/o carry the method

SYNOPSIS ^

    my $vfs = VFSsimple->new($url)
        or die "can't get the vfs";

    $vfs->copy("path/fichier", "/tmp/fichier")
        or die "can't get file";

FUNCTIONS ^

new($root, $options)

Instanciate a new VFSimple object over $root url.

$root The root of the vfs

$options is a hashref:

vfs

Force the virtal access method to use

url parsing

The $root should be a valid url:

    protocol://server/path
    file://path

A standard file path can also be used, understood as file://.

The access method to use is find automatically using url infromation:

- protocol from url - if protocol is either file:// or ext:// and target is a file, the extension is use.

The automatic behavior can overide by setting vfs option.

For local file abstraction, an additionnal path can be append to set the root inside the archive:

    file://path/file.ext/subpath

root

Return the root of the VFS.

error

Return the last error.

get($src)

Fetch the file if necessary, and return the local location where it has been copied.

open($src)

Fetch the file if necessary and return an open file handle on it.

copy($src, $dest)

Copy $src file from vfs into $dest local file

exists($file)

Return True if $file exists on the VFS

LICENSE AND COPYRIGHT ^

(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.
syntax highlighting: