Hi fellow monks,

Just for fun, I'm busy building a new podcatcher in Perl. LWP is a cool module, but it doesn't support resume out of the box, and since downloads could potentially be broken, I'd like to make sure I can build a resume function into my code.

Resuming isn't something that comes natively to LWP. To do this, I would most likely have to read the headers, look for something like Ranges: to confirm the webserver does indeed support resuming, then ask the server to give me a part of the file, then check if the server will give me that part, or start the download fresh. (in some cases I wonder why I don't just do wget -c $url here)

So that's the thinking at least... Any other "perl's" of wisdom you could add to the mix? Hopefully there's another module that could take care of resume downloading?

Thanks as always for the kind assistance.

Cheers, and happy Australia day..

Massyn


In reply to Resuming downloads with LWP? by Massyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.