473,804 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a simple wget in C language?

Hello everybody,

I have a little problem with a littre program i'm writting :
I use the system(char* s) function in my program to retreve an information.
The problem is that when wget in launched and as retrieved the file, my
program stops instatanly....

So I see two possible solutions :
1\ making system() not exiting after executin wget
2\ building a little wget as a function of my program

but I don't know how to do such things ... that's why I'm here ;)

Someone could help me? (sorry for the bad englesh ;) )
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004
Nov 14 '05 #1
9 7756
"olivier HARO" <o.****@en-compro.com> wrote in message
news:41******** **************@ news.astraweb.c om...
Hello everybody,

I have a little problem with a littre program i'm writting :
I use the system(char* s) function in my program to retreve an information. The problem is that when wget in launched and as retrieved the file, my
program stops instatanly....

So I see two possible solutions :
1\ making system() not exiting after executin wget
2\ building a little wget as a function of my program

but I don't know how to do such things ... that's why I'm here ;)

Someone could help me? (sorry for the bad englesh ;) )

Do you mind posting a small working case of your code.
--
Imanpreet Singh Arora
Zmoc.Zliamg@Zte erpnami
Remove Z to mail
"Things may come to those who wait, but only the things left by those who
hustle."
Abraham Lincoln
Nov 14 '05 #2
Minti wrote:
"olivier HARO" <o.****@en-compro.com> wrote in message

I have a little problem with a littre program i'm writting :

I use the system(char* s) function in my program to retreve an
information. The problem is that when wget in launched and as
retrieved the file, my program stops instatanly....
.... snip ...
Do you mind posting a small working case of your code.


No, please don't. wget is off-topic here, as is anything run by
system() (but not the call to system itself). I think you want
comp.unix.progr ammer (or similar).

Minti has been around here before, and should know better than to
encourage off-topic postings.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #3


"CBFalconer " <cb********@yah oo.com> wrote in message
news:41******** *******@yahoo.c om...
Minti wrote:
"olivier HARO" <o.****@en-compro.com> wrote in message

I have a little problem with a littre program i'm writting :

I use the system(char* s) function in my program to retreve an
information. The problem is that when wget in launched and as
retrieved the file, my program stops instatanly....

... snip ...

Do you mind posting a small working case of your code.


No, please don't. wget is off-topic here, as is anything run by
system() (but not the call to system itself). I think you want
comp.unix.progr ammer (or similar).

Minti has been around here before, and should know better than to
encourage off-topic postings.


Thanks, but I just did not want to get to the conclusion straight away that
the problem was caused by @system@.
--
Imanpreet Singh Arora
Zmoc.Zliamg@Zte erpnami
Remove Z to mail
"Things may come to those who wait, but only the things left by those who
hustle."
Abraham Lincoln
Nov 14 '05 #4
there is a thing that is nor off-subject :
is there anywere a free C function that I could use to download a web page
from a URL?
"Minti" <mi************ @yahoo.com> a écrit dans le message de
news:2t******** *****@uni-berlin.de...


"CBFalconer " <cb********@yah oo.com> wrote in message
news:41******** *******@yahoo.c om...
Minti wrote:
"olivier HARO" <o.****@en-compro.com> wrote in message
>
> I have a little problem with a littre program i'm writting :
>
> I use the system(char* s) function in my program to retreve an
> information. The problem is that when wget in launched and as
> retrieved the file, my program stops instatanly.... ... snip ...

Do you mind posting a small working case of your code.


No, please don't. wget is off-topic here, as is anything run by
system() (but not the call to system itself). I think you want
comp.unix.progr ammer (or similar).

Minti has been around here before, and should know better than to
encourage off-topic postings.


Thanks, but I just did not want to get to the conclusion straight away

that the problem was caused by @system@.
--
Imanpreet Singh Arora
Zmoc.Zliamg@Zte erpnami
Remove Z to mail
"Things may come to those who wait, but only the things left by those who
hustle."
Abraham Lincoln

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004
Nov 14 '05 #5
olivier HARO <o.****@en-compro.com> scribbled the following:
there is a thing that is nor off-subject :
is there anywere a free C function that I could use to download a web page
from a URL?


Not in standard C.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"'So called' means: 'There is a long explanation for this, but I have no
time to explain it here.'"
- JIPsoft
Nov 14 '05 #6
I have found a issue ....
ok, this is a little dirty but it works ;)

when i use a sleep() after the system() ... the program goes on... ;)
in fact, the program don't wait the end of the system() function execution
to continue executing the next lines.
That's why it was bugging....

"Joona I Palaste" <pa*****@cc.hel sinki.fi> a écrit dans le message de
news:ck******** **@oravannahka. helsinki.fi...
olivier HARO <o.****@en-compro.com> scribbled the following:
there is a thing that is nor off-subject :
is there anywere a free C function that I could use to download a web page from a URL?


Not in standard C.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"'So called' means: 'There is a long explanation for this, but I have no
time to explain it here.'"
- JIPsoft

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004
Nov 14 '05 #7

I think now I know what Chuck meant. BTW please don't toppost its for
assholes.
--
Imanpreet Singh Arora
Zmoc.Zliamg@Zte erpnami
Remove Z to mail

"olivier HARO" <o.****@en-compro.com> wrote in message
news:41******** **************@ news.astraweb.c om...
there is a thing that is nor off-subject :
is there anywere a free C function that I could use to download a web page
from a URL?
"Minti" <mi************ @yahoo.com> a écrit dans le message de
news:2t******** *****@uni-berlin.de...


"CBFalconer " <cb********@yah oo.com> wrote in message
news:41******** *******@yahoo.c om...
Minti wrote:
> "olivier HARO" <o.****@en-compro.com> wrote in message
>>
>> I have a little problem with a littre program i'm writting :
>>
>> I use the system(char* s) function in my program to retreve an
>> information. The problem is that when wget in launched and as
>> retrieved the file, my program stops instatanly....
... snip ...
>
> Do you mind posting a small working case of your code.

No, please don't. wget is off-topic here, as is anything run by
system() (but not the call to system itself). I think you want
comp.unix.progr ammer (or similar).

Minti has been around here before, and should know better than to
encourage off-topic postings.


Thanks, but I just did not want to get to the conclusion straight away

that
the problem was caused by @system@.
--
Imanpreet Singh Arora
Zmoc.Zliamg@Zte erpnami
Remove Z to mail
"Things may come to those who wait, but only the things left by those who hustle."
Abraham Lincoln

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004

Nov 14 '05 #8
Minti <mi************ @yahoo.com> scribbled the following:
I think now I know what Chuck meant. BTW please don't toppost its for
assholes.


Heh heh.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"To know me IS to love me."
- JIPsoft
Nov 14 '05 #9
In article <ck**********@o ravannahka.hels inki.fi>, Joona I Palaste wrote:
olivier HARO <o.****@en-compro.com> scribbled the following:
there is a thing that is nor off-subject :
is there anywere a free C function that I could use to download a web page
from a URL?


Not in standard C.


indeed, not in standaard C. But there are some libraries which come
in pretty handy, like libcurl (http://curl.haxx.se/libcurl/)

Ilja
--
Ilja Booij
IC&S B.V.
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8175
by: Martin | last post by:
I have a PHP script that should be run a few times a day. Currently I run this script manually as I haven't been able to set up Lynx or wget to run it as a cronjob. Or to be more specific: the script works, but both wget and Lynx fail after 10 or 20 redirects, then it warns: wget: 20 redirections exceeded. Lynx: Alert!: Redirection limit of 10 URL's reached. What the scripts does is download various HTML pages (allowed by the owners)...
1
4011
by: LRW | last post by:
In a PHP script I have the following two lines: $thumbproc = escapeshellcmd("wget -q -T 2000 http://(A URL)/pa-thumbs/createthumbs.php?dir=".$order_po." &"); exec("$thumbproc 2>&1", $output); Works perfectly...except, it always waits until it finished with the wget before it continues in the script. Normally this wouldn't be a problem, except this wget is calling a page that's doing some image manipulation that can take up to two
7
7723
by: Ken | last post by:
How do I call c:\wget\wget.exe from a php or html file? so I can use php variables to define the file names to download. I want to set up wget to download several files from a server to my hard drive so they can be used internally. Ken
2
1948
by: Robert P. J. Day | last post by:
just getting started with python, and i'm designing a program for fetching software from the net, given the package name, version number and/or date stamp, download method (tarball, CVS, etc.) and so on. i've already got a shell script doing this, but python would certainly clean up the code a lot. first question -- does such a utility/module (or something like it) already exist? that is, with the ability to say, "go get me gcc,...
2
4776
by: Google Mike | last post by:
I have an RH9 Linux PHP 4.2.2 web page that I need to call a Bash file under the context of root and do the wget command to download a file, clobbering the previous download of this same filename. It's bombing without leaving any trace. I tried introducing all manner of chmod, chown, sudo, and sticky bit, but this fails. The only thing I see in the syslog is failed sudo authenticaiton for user Apache. What's the technique to get this...
7
9496
by: petr pilsl | last post by:
sorry - no idea where to post my question, so I crossposted to a linux and a html-authoring-group. Both groups might be familiar with wget. wget -p http://www.goldfisch.at does not load the images embedded in this website. I wonder why? according to the man-page : -p
3
7853
by: Jesse | last post by:
Hi all, I have a problem using wget and Popen. I hope someone can help. -- Problem -- I want to use the command: wget -nv -O "dir/cpan.txt" "http://search.cpan.org" and capture all it's stdout+stderr. (Note that option -O requires 'dir' to be existing before wget is executed) Popen doesn't work, while os.system and shell do. Popen will give the error:
9
1510
by: deja | last post by:
Hi all, For a couple of nights I have been trying to figure something out.. I am trying insert a couple of fields into a database. My url looks something like this; www.site.com/addlog.php?var1=blah&var2=blah The addlog.php script looks like this;
2
3560
by: Don69 | last post by:
I have a problem with PHP where wget generates 0 byte files. Below is the code that I use. // ******************** $savedir = "/webroot/vifs/app/webroot/static/1234567890"; $url = "http://www.google.com"; $test = mkdir( $savedir, 0777);
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.