GGarramuno wrote:
> 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";
>       }
> 
> Or am I forced to write all the code of File.new() and handle the
> rescue exceptions myself?
> 

Check out methods of module FileTest p FileTest.methods). Class File 
extends this module, so you can write:

File.readable? "afile"

If "aFile" does not exist, File.readable? returns false.

Gennady.