Ruby: wait for system command to end

Posted by Ignace on Stack Overflow See other posts from Stack Overflow or by Ignace
Published on 2010-05-26T06:16:04Z Indexed on 2010/05/26 6:21 UTC
Read the original article Hit count: 280

Filed under:

Hey all,
I'm converting an xls 2 csv with a system(command) in ruby.
After the conversion i'm processing this csv files.
But the conversion is still going when the program wants to process the files. So at that time they are non existant.
Can someone tell me if it's possible to let Ruby wait the right amount of time for the system command to finish?
Right now i'm using sleep 20 but if it will take longer once, it isn't right of course... Thanks!

© Stack Overflow or respective owner

Related posts about ruby