[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

backtick vs. system

Peter.Meier998

6/18/2007 3:17:00 PM

Hi,

I have problems with the difference between the system() call and a
backtick call `command`.

Everything work fine until I try to redirect the output of the script.

Ex.
puts `ls`
system('ls')

A normal run is fine.
The redirected version with test.rb >test.log 2>&1 stops with
"bad file descriptor".
If you try the command independent, you will see that system() causes
the problem.
Any hints?

I used system, due I can see the output during the run.
With puts `ls` it will be only visible at the end.

Thanks
Peter