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

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

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

    wait until

    Brad Smallridge, Mar 23, 2005, in forum: VHDL
    Replies:
    2
    Views:
    770
    info_
    Mar 26, 2005
  2. TJS
    Replies:
    2
    Views:
    933
    Kevin Spencer
    Feb 11, 2004
  3. Replies:
    5
    Views:
    877
  4. pat
    Replies:
    1
    Views:
    387
  5. sophie_newbie
    Replies:
    9
    Views:
    351
    sophie_newbie
    Apr 24, 2008
  6. mikew01

    wait finishes early?

    mikew01, Dec 8, 2009, in forum: Java
    Replies:
    6
    Views:
    577
    Daniel Pitts
    Dec 10, 2009
  7. Replies:
    4
    Views:
    244
  8. Replies:
    1
    Views:
    214
Loading...