NAME
Slackware::Slackget::Network::Connection::FILE - This class is the file:// protocol driver for Slackware::Slackget::Network::Connection
VERSION
Version 1.0.0
SYNOPSIS
This class is the file:// protocol driver for Slackware::Slackget::Network::Connection.
You can't use this class without the Slackware::Slackget::Network::Connection one.
This class need the following extra CPAN modules :
- File::Copy
- Time::HiRes
CONSTRUCTOR
new
This class is not designed to be instanciate alone or used alone. You have to use the Slackware::Slackget::Network::Connection.
FUNCTIONS
__test_server
This method test the rapidity of the repository, by timing a copy of the FILELIST.TXT file.
my $time = $self->test_server() ;
__get_file
Return the given file.
my $file = $connection->get_file('PACKAGES.TXT') ;
You can pass an extra argument (boolean) to mark the file as a binary one.
__fetch_file
Copy a given file to a given location.
$connection->fetch_file() ; # download the file $connection->file and store it at $config->{common}->{'update-directory'}/$connection->file, this way is not recommended
or
$connection->fetch_file($remote_file) ; # download the file $remote_file and store it at $config->{common}->{'update-directory'}/$connection->file, this way is not recommended
or
$connection->fetch_file('PACKAGES.TXT',"$config->{common}->{'update-directory'}/".$current_specialfilecontainer_object->id."/PACKAGES.TXT") ; # This is the recommended way.
# This is equivalent to : $connection->fetch_file($remote_file,$local_file) ;
This method return a Slackware::Slackget::Status object with the following object declaration :
my $state = Slackware::Slackget::Status->new(codes => {
0 => "All goes well. Server said: $ret_code - ".status_message( $ret_code ),
1 => "Destination directory does not exist.\n",
2 => "Destination directory is not writable.\n",
});
This is the direct code of this method :)
__fetch_all
This method fetch all files declare in the "files" parameter of the constructor.
$connection->fetch_all or die "Unable to fetch all files\n";
This method save all files in the $config->{common}->{'update-directory'} directory (so you have to manage yourself the files deletion/replacement problems)
AUTHOR
DUPUIS Arnaud, <a.dupuis@infinityperl.org>
BUGS
Please report any bugs or feature requests to bug-Slackware-Slackget@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Slackware-Slackget. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Slackware::Slackget
You can also look for information at:
Infinity Perl website
slack-get specific website
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
Thanks to Bertrand Dupuis (yes my brother) for his contribution to the documentation.
COPYRIGHT & LICENSE
Copyright 2005 DUPUIS Arnaud, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.