Joel VanderWerf
7/26/2008 6:10:00 PM
aidy wrote:
> begin
> system("taskkill /im firefox.exe /f")
> rescue
> #preventing exception if firefox process does not exist
> end
Kernel#system doesn't raise exceptions. Check the return value and $?.
---------------------------------------------------------- Kernel#system
system(cmd [, arg, ...]) => true or false
------------------------------------------------------------------------
Executes _cmd_ in a subshell, returning +true+ if the command was
found and ran successfully, +false+ otherwise. An error status is
available in +$?+. The arguments are processed in the same way as
for +Kernel::exec+.
system("echo *")
system("echo", "*")
_produces:_
config.h main.rb
*
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407