WebFS::FileCopy is a Perl module to get, put, move, copy, and delete files located by URIs.
SYNOPSIS
use WebFS::FileCopy;
my @res = get_urls('ftp://www.perl.com', 'http://www.netscape.com');
print $res[0]->content if $res[0]->is_success;
# Get content from pages requiring basic authentication.
my $req = LWP::Request->new('GET' => 'http://www.dummy.com/');
$req->authorization_basic('my_username', 'my_password');
@res = get_urls($req);
put_urls('put this text', 'ftp://ftp/incoming/new', 'file:/tmp/NEW');
move_url('file:/tmp/NEW', 'ftp://ftp/incoming/NEW.1');
delete_urls('ftp://ftp/incoming/NEW.1', 'file:/tmp/NEW');
copy_url('http://www.perl.com/index.html', 'ftp://ftp.host/outgoing/SIG');
copy_urls(['file:/tmp/file1', 'http://www.perl.com/index.html],
['file:/tmp/DIR1/', 'file:/tmp/DIR2', 'ftp://ftp/incoming/']);
my @list1 = list_url('file:/tmp');
my @list2 = list_url('ftp://ftp/outgoing/');
This package provides some simple routines to read, move, copy, and delete files as references by string URLs, URI objects or URIs embedded in HTTP::Reqeust or LWP::Request objects. All subroutines in this package that expect a URI will accept a string, a URI object, or a HTTP::Reqeust or LWP::Request with an embedded URI. If passed a HTTP::Request or LWP::Request, then the method of the object is ignored and the proper method will be used to either GET or PUT the requested UIR.
The distinction between files and directories in a URI is tested by looking for a trailing / in the path. If a trailing / exists, then the URI is considered to point to a directory, otherwise it is a file.
All of the following subroutines are exported to the users namespace automatically. If you do not want this, then require this package instead of useing it.
Product's homepage
Requirements:
· Perl