I am running Ruby 1.8.2 on a XP machine. I have several programs
(executables) which convert text files to a special file format. I
would like to have these programs run from within a ruby script and
check the return code.
In general how would you call the foo.exe program in ruby and check
return code.
I am running Ruby 1.8.2 on a XP machine. I have several programs
(executables) which convert text files to a special file format. I
would like to have these programs run from within a ruby script and
check the return code.
In general how would you call the foo.exe program in ruby and check
return code.
Read ri Process::Status for more information on the Process::Status Class.
regards,
Brian
···
On 15/08/05, LenS <lsumnler@uniqueinsuranceco.com> wrote:
I am running Ruby 1.8.2 on a XP machine. I have several programs
(executables) which convert text files to a special file format. I
would like to have these programs run from within a ruby script and
check the return code.
In general how would you call the foo.exe program in ruby and check
return code.
I am running Ruby 1.8.2 on a XP machine. I have several programs
(executables) which convert text files to a special file format. I
would like to have these programs run from within a ruby script and
check the return code.
In general how would you call the foo.exe program in ruby and check
return code.
Thanks
Len Sumnler
--
email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna
The $? is a thread-local variable, so there is nothing bad about using
it like I did above. There is no possibility that another command
changes the $? before it is returned by "execute". And if you put it
into a function like I did you'll never again the the dollar sign.
Maybe the above mini-function could even get into facets if it's not
already there. Then you would never ever have seen the dollar sign.
regards,
Brian
···
On 30/08/05, David Vallner <david@vallner.net> wrote:
Brian Schröder wrote:
>On 15/08/05, LenS <lsumnler@uniqueinsuranceco.com> wrote:
>
>>In general how would you call the foo.exe program in ruby and check
>>return code.
>>
>>
>def execute(*args)
> system(*args)
> $?
>end
>
>
As a sworn hater of magic global variables, I'd like to know: Is there
any way to do this that doesn't involve the "$?" ? Cheers