|
Home > Archive > Unix Programming > December 2005 > Problem using wget
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem using wget
|
|
|
| Hi,
I am using "wget" utility in my application to read a webpage. I have
following questions using wget:
1. Is wget thread-safe?
2. Is there any way to buffer the output of wget (not to dump in any
file to read the page content), and read the content from buffer. In my
requirement, i will be using wget for each user entering my
application. In such case, creating a temp file for each user, reading
that file and deleting the temp file will be an overhead. any
suggestions how to read webpage content without using intermediate file
processing?
NOTE: I am not supposed to use cURL.
Thanks in advance,
-Yogi
| |
| Nils O. Selåsdal 2005-12-27, 7:49 am |
| Yogi wrote:
> Hi,
> I am using "wget" utility in my application to read a webpage. I have
> following questions using wget:
> 1. Is wget thread-safe?
running wget results in a new process, one process per invocation.
Are you calling wget from a C program ?
> 2. Is there any way to buffer the output of wget (not to dump in any
> file to read the page content), and read the content from buffer. In my
> requirement, i will be using wget for each user entering my
> application. In such case, creating a temp file for each user, reading
> that file and deleting the temp file will be an overhead. any
> suggestions how to read webpage content without using intermediate file
> processing?
If you're calling wget from C, perhaps you want the popen function, or
the pipe/fork/dup2/exec if you need more control.
wget has a switch for sending the page it retreives to standard output.
| |
| Bjorn Reese 2005-12-27, 7:49 am |
| Yogi wrote:
> NOTE: I am not supposed to use cURL.
Why not? It solves your problems.
--
mail1dotstofanetdotdk
|
|
|
|
|