fetching to docs using wget
- From: testabhi@xxxxxxxxx (A B)
- Date: Tue, 22 Jul 2008 18:23:31 +0530
Hi,
I am trying to fetch various docs from server using wget. Below is the code
Files are downloading but of 0 size :(
Am i missing any thing
adave@adave:~/adave> cat fetch.pl
open(S,"<./source.txt") || die "Failed to open file 'source.txt' $!";
while(<S>)
{
if (/http/)
{
@a=split(/\//,$_);
$file=$a[-1];
$r=exec `/usr/bin/wget $_ >./$file `;
print $r;
print "Printing the output of last $?";
exit;
}
}
close(S);
adave@adave:~/adave> perl fetch.pl
--18:03:19-- http://localhost/training_files/docs/overview.ppt
=> `overview.ppt'
Resolving localhost... x.x.x.x.
Connecting to localhost x.x.x.x... connected.
HTTP request sent, awaiting response... 200 OK
Length: 145,920 [application/vnd.ms-powerpoint]
100%[==================================================================================================================>]
145,920 81.61K/s
18:03:21 (81.43 KB/s) - `overview.ppt' saved [145920/145920]
0Printing the output of last 0adave@adave:~/adave> ls -l
total 5
-rw-r--r-- 1 adave aix 254 2008-07-22 17:48 fetch.pl
-rw-r--r-- 1 adave aix 4074 2008-07-22 16:52 source.txt
-rw-r--r-- 1 adave aix 0 2008-07-22 18:03 overview.ppt
Thanks,
a b
- Follow-Ups:
- Re: fetching to docs using wget
- From: Rob Dixon
- Re: fetching to docs using wget
- Prev by Date: RE: parsing a large excel file
- Next by Date: Re: fetching to docs using wget
- Previous by thread: DBI error
- Next by thread: Re: fetching to docs using wget
- Index(es):
Relevant Pages
|