Will a "system call" wait until the command finishes?

Discussion in 'Ruby' started by sayoyo Sayoyo, Feb 15, 2008.

  1. Hi,

    I wish to know, if I use system() to execute a time consuming task, will
    ruby wait until the task is finished or it will automatically interprete
    the next line?

    Thanks you very much

    sayoyo
    --
    Posted via http://www.ruby-forum.com/.
     
    sayoyo Sayoyo, Feb 15, 2008
    #1
    1. Advertising

  2. sayoyo Sayoyo

    Reacher Guest

    On Feb 15, 2:44 pm, sayoyo Sayoyo <> wrote:
    > Hi,
    >
    > I wish to know, if I use system() to execute a time consuming task, will
    > ruby wait until the task is finished or it will automatically interprete
    > the next line?
    >
    > Thanks you very much
    >
    > sayoyo
    > --
    > Posted viahttp://www.ruby-forum.com/.


    it appears that Ruby will wait. try this
    $ ruby -e 'system("sleep 5");p "hi"'
     
    Reacher, Feb 15, 2008
    #2
    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. Replies:
    5
    Views:
    745
  2. pat
    Replies:
    1
    Views:
    307
  3. sophie_newbie
    Replies:
    9
    Views:
    259
    sophie_newbie
    Apr 24, 2008
  4. Replies:
    4
    Views:
    164
  5. Replies:
    1
    Views:
    140
Loading...

Share This Page