From: Andrew Walrond Date: 2004-06-29T04:22:27+09:00 Subject: system() shouldn't throw exceptions, should it? While building a Rubyx distro (the build script is written in ruby) a user has reported this error: > > Making 'whatis' database... > > Unmounting proc > /mnt/rubyx/rubyx-76/rubyx:946:in `system': No such file or directory - > makewhatis /man (Errno::ENOENT) > from /mnt/rubyx/rubyx-76/rubyx:946:in `install' > from /mnt/rubyx/rubyx-76/rubyx:800:in `each' > from /mnt/rubyx/rubyx-76/rubyx:800:in `install' > from /mnt/rubyx/rubyx-76/rubyx:1492 > from /mnt/rubyx/rubyx-76/rubyx:1087:in `catch' > from /mnt/rubyx/rubyx-76/rubyx:1087 > root@aydindril:/mnt/rubyx/linux-2.6.7/linux-2.6.7# The bit of code running here looks like this: if $root=='/' puts("Making 'whatis' database...") system("makewhatis /man") end Now makewhatis is not available, but the system() command has thrown an exception, which shouldn't happen (should it?). According to ri system, --------------------------------------------------------- Kernel::system system( aCmd [, args]* ) -> true or false ------------------------------------------------------------------------ Executes aCmd in a subshell, returning true if the command was found and ran successfully, false otherwise. A detailed error code is available in $?. The arguments are processed in the same way as for Kernel::exec on page 419. So on failure it should just return false? Am I reading this correctly? Could this be ruby version specific? Andrew Walrond