* GGarramuno <GGarramuno / aol.com> [2004-01-06 16:52]:
> Is there anything in Ruby similar to Perl's if -r, -x, etc. switches? 
> These switches work with variables as if they were files and they are
> used in simple, silent and quick constructs like:
>       if -r $file {
>              print "$file is readable\n";
>       }

You can use the FileTest methods, e.g.

FileTest.executable?("/bin/ls")       #=> true
FileTest.executable?("/etc/passwd")   #=> false

Some documentation is in 'ri', or on the Web here:
http://www.rubycentral.com/book/ref_m_filetest.html

-- Mike

-- 
Michael W. Thelen
People will accept your ideas much more readily if you tell them Benjamin
Franklin said it first.
                -- David H. Comins