From: Yohanes Santoso Date: 2002-03-06T23:07:49+09:00 Subject: Improvement to system() Hi, I just got bitten by return value of system() because it does not distinguish invalid command and error code resulted from executing command. irb(main):014:0> system "/bin/falsed" false irb(main):015:0> system "/bin/false" false Quickly, why did the first one returns false, and why did the second one returns false? Did you instantly catch the typo? Sometimes the command to be executed is determined at some other place. Thus, if system(*cmd) returns false, there's no easy way to determine why it fails. A solution is to use File.stat.executable? But even directories are executable. Any better solution? YS.