On Tue, Nov 11, 2008 at 15:38, JC Janos <[EMAIL PROTECTED]> wrote:
> Chas,
>
>> my $status = mirror($url, $file);
>>
>> if ($status == RC_OK) {
>>        print "got file\n";
>> } elsif ($status == RC_NOT_MODIFIED) {
>>        print "didn't need to get the file\n";
>
> That's a good example, thanks.  LWP looks like a good alternative; one
> question ...
>
> As I use "wget --timestamping ...", it doesn't DL the file unless the
> timestamp is different.
>
> Is LWP::Simple's mirror() function similar to wget's "--mirror"
> option, in that it supports/uses timestamping?
>
> Looking at your example I see
>
>   "didn't need to get the file"
>
> does that mean that it DID retrieve the file, and simply determined
> that it wasn't necessary?  Or that it 1st determined that it wasn't
> necessary and didn't even DL the file?
>
> --JC
>

>From http://search.cpan.org/dist/libwww-perl/lib/LWP/Simple.pm#mirror

mirror($url, $file)
    Get and store a document identified by a URL, using
If-modified-since, and checking the Content-Length. Returns the HTTP
response code.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to