a simple wget in C language?

Discussion in 'C Programming' started by olivier HARO, Oct 14, 2004.

  1. olivier HARO

    olivier HARO Guest

    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
     
    olivier HARO, Oct 14, 2004
    #1
    1. Advertising

  2. olivier HARO

    Minti Guest

    "olivier HARO" <> wrote in message
    news:416ea206$0$11919$...
    > 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@Zteerpnami
    Remove Z to mail
    "Things may come to those who wait, but only the things left by those who
    hustle."
    Abraham Lincoln
     
    Minti, Oct 14, 2004
    #2
    1. Advertising

  3. olivier HARO

    CBFalconer Guest

    Minti wrote:
    > "olivier HARO" <> 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.programmer (or similar).

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

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
     
    CBFalconer, Oct 14, 2004
    #3
  4. olivier HARO

    Minti Guest

    "CBFalconer" <> wrote in message
    news:...
    > Minti wrote:
    > > "olivier HARO" <> 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.programmer (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@Zteerpnami
    Remove Z to mail
    "Things may come to those who wait, but only the things left by those who
    hustle."
    Abraham Lincoln
     
    Minti, Oct 14, 2004
    #4
  5. olivier HARO

    olivier HARO Guest

    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" <> a écrit dans le message de
    news:...
    >
    >
    > "CBFalconer" <> wrote in message
    > news:...
    > > Minti wrote:
    > > > "olivier HARO" <> 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.programmer (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@Zteerpnami
    > 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
     
    olivier HARO, Oct 15, 2004
    #5
  6. olivier HARO <> 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 () ------------- Finland --------\
    \-------------------------------------------------------- rules! --------/
    "'So called' means: 'There is a long explanation for this, but I have no
    time to explain it here.'"
    - JIPsoft
     
    Joona I Palaste, Oct 15, 2004
    #6
  7. olivier HARO

    olivier HARO Guest

    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" <> a écrit dans le message de
    news:cknv0q$fun$...
    > olivier HARO <> 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 () ------------- 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
     
    olivier HARO, Oct 15, 2004
    #7
  8. On Fri, 15 Oct 2004 10:32:46 +0200, "olivier HARO"
    <> wrote:

    >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....


    sleep() is not a standard C function either.


    <<Remove the del for email>>
     
    Barry Schwarz, Oct 15, 2004
    #8
  9. olivier HARO

    Minti Guest

    I think now I know what Chuck meant. BTW please don't toppost its for
    assholes.


    --
    Imanpreet Singh Arora
    Zmoc.Zliamg@Zteerpnami
    Remove Z to mail



    "olivier HARO" <> wrote in message
    news:416f7e27$0$86539$...
    > 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" <> a écrit dans le message de
    > news:...
    > >
    > >
    > > "CBFalconer" <> wrote in message
    > > news:...
    > > > Minti wrote:
    > > > > "olivier HARO" <> 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.programmer (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@Zteerpnami
    > > 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
    >
    >
     
    Minti, Oct 15, 2004
    #9
  10. Minti <> scribbled the following:
    > I think now I know what Chuck meant. BTW please don't toppost its for
    > assholes.


    Heh heh.

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-------------------------------------------------------- rules! --------/
    "To know me IS to love me."
    - JIPsoft
     
    Joona I Palaste, Oct 15, 2004
    #10
  11. olivier HARO

    Ilja Booij Guest

    In article <cknv0q$fun$>, Joona I Palaste wrote:
    > olivier HARO <> 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.
     
    Ilja Booij, Nov 3, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert P. J. Day
    Replies:
    2
    Views:
    398
    Robert P. J. Day
    Dec 16, 2004
  2. Yang
    Replies:
    6
    Views:
    3,748
  3. Jesse

    Popen and wget, problems

    Jesse, May 12, 2007, in forum: Python
    Replies:
    3
    Views:
    538
  4. Replies:
    2
    Views:
    134
    Peter J. Holzer
    Jul 21, 2007
  5. Replies:
    0
    Views:
    102
Loading...

Share This Page