man-pages/man1/lwp-download.1p.html
2021-03-31 01:06:50 +01:00

116 lines
3.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of LWP-DOWNLOAD</TITLE>
</HEAD><BODY>
<H1>LWP-DOWNLOAD</H1>
Section: User Contributed Perl Documentation (1p)<BR>Updated: 2019-11-29<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
lwp-download - Fetch large files from the web
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
lwp-download [-a] [-s] &lt;url&gt; [&lt;local path&gt;]
Options:
-a save the file in ASCII mode
-s use HTTP headers to guess output filename
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The <B>lwp-download</B> program will save the file at <I>url</I> to a local
file.
<P>
If <I>local path</I> is not specified, then the current directory is
assumed.
<P>
If <I>local path</I> is a directory, then the last segment of the path of the
<I>url</I> is appended to form a local filename. If the <I>url</I> path ends with
slash the name ``index'' is used. With the <B>-s</B> 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 <B>lwp-download</B> 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.
<P>
If <I>local path</I> is not a directory, then it is simply used as the
path to save into. If the file already exists it's overwritten.
<P>
The <I>lwp-download</I> program is implemented using the <I>libwww-perl</I>
library. It is better suited to down load big files than the
<I>lwp-request</I> 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.
<P>
Use the <TT>&quot;-a&quot;</TT> option to save the file in text (<FONT SIZE="-1">ASCII</FONT>) mode. Might
make a difference on DOSish systems.
<A NAME="lbAE">&nbsp;</A>
<H2>EXAMPLE</H2>
Fetch the newest and greatest perl version:
<P>
<PRE>
$ lwp-download <A HREF="http://www.perl.com/CPAN/src/latest.tar.gz">http://www.perl.com/CPAN/src/latest.tar.gz</A>
Saving to 'latest.tar.gz'...
11.4 MB received in 8 seconds (1.43 MB/sec)
</PRE>
<A NAME="lbAF">&nbsp;</A>
<H2>AUTHOR</H2>
Gisle Aas &lt;<A HREF="mailto:gisle@aas.no">gisle@aas.no</A>&gt;
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">EXAMPLE</A><DD>
<DT id="5"><A HREF="#lbAF">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:18 GMT, March 31, 2021
</BODY>
</HTML>