Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lwp-download(1) [suse man page]

LWP-DOWNLOAD(1) 					User Contributed Perl Documentation					   LWP-DOWNLOAD(1)

NAME
lwp-download - Fetch large files from the web SYNOPSIS
lwp-download [-a] [-s] <url> [<local path>] DESCRIPTION
The lwp-download program will save the file at url to a local file. If local path is not specified, then the current directory is assumed. If local path is a directory, then the last segment of the path of the url is appended to form a local filename. If the url path ends with slash the name "index" is used. With the -s option pick up the last segment of the filename from server provided sources like the Content- Disposition header or any redirect URLs. A file extension to match the server reported Content-Type might also be appended. If a file with the produced filename already exists, then lwp-download will prompt before it overwrites and will fail if its standard input is not a terminal. This form of invocation will also fail is no acceptable filename can be derived from the sources mentioned above. If local path is not a directory, then it is simply used as the path to save into. If the file already exists it's overwritten. The lwp-download program is implemented using the libwww-perl library. It is better suited to down load big files than the lwp-request program because it does not store the file in memory. Another benefit is that it will keep you updated about its progress and that you don't have much options to worry about. Use the "-a" option to save the file in text (ascii) mode. Might make a difference on dosish systems. EXAMPLE
Fetch the newest and greatest perl version: $ lwp-download http://www.perl.com/CPAN/src/latest.tar.gz Saving to 'latest.tar.gz'... 11.4 MB received in 8 seconds (1.43 MB/sec) AUTHOR
Gisle Aas <gisle@aas.no> perl v5.12.1 2010-07-05 LWP-DOWNLOAD(1)

Check Out this Related Man Page

CPANPLUS::Internals::Fetch(3)				User Contributed Perl Documentation			     CPANPLUS::Internals::Fetch(3)

NAME
CPANPLUS::Internals::Fetch - internals for fetching files SYNOPSIS
my $output = $cb->_fetch( module => $modobj, fetchdir => '/path/to/save/to', verbose => BOOL, force => BOOL, ); $cb->_add_fail_host( host => 'foo.com' ); $cb->_host_ok( host => 'foo.com' ); DESCRIPTION
CPANPLUS::Internals::Fetch fetches files from either ftp, http, file or rsync mirrors. This is the rough flow: $cb->_fetch Delegate to File::Fetch; METHODS
$path = _fetch( module => $modobj, [fetchdir => '/path/to/save/to', fetch_from => 'scheme://path/to/fetch/from', verbose => BOOL, force => BOOL, prefer_bin => BOOL, ttl => $seconds] ) "_fetch" will fetch files based on the information in a module object. You always need a module object. If you want a fake module object for a one-off fetch, look at "CPANPLUS::Module::Fake". "fetchdir" is the place to save the file to. Usually this information comes from your configuration, but you can override it expressly if needed. "fetch_from" lets you specify an URI to get this file from. If you do not specify one, your list of configured hosts will be probed to download the file from. "force" forces a new download, even if the file already exists. "verbose" simply indicates whether or not to print extra messages. "prefer_bin" indicates whether you prefer the use of commandline programs over perl modules. Defaults to your corresponding config setting. "ttl" (in seconds) indicates how long a cached copy is valid for. If the fetch time of the local copy is within the ttl, the cached copy is returned. Otherwise, the file is refetched. "_fetch" figures out, based on the host list, what scheme to use and from there, delegates to "File::Fetch" do the actual fetching. Returns the path of the output file on success, false on failure. Note that you can set a "blacklist" on certain methods in the config. Simply add the identifying name of the method (ie, "lwp") to: $conf->_set_fetch( blacklist => ['lwp'] ); And the "LWP" function will be skipped by "File::Fetch". _add_fail_host( host => $host_hashref ) Mark a particular host as bad. This makes "CPANPLUS::Internals::Fetch" skip it in fetches until this cache is flushed. _host_ok( host => $host_hashref ) Query the cache to see if this host is ok, or if it has been flagged as bad. Returns true if the host is ok, false otherwise. perl v5.16.3 2013-05-20 CPANPLUS::Internals::Fetch(3)
Man Page