find out if it is a directory with directory?:
# try it with a directory File::directory?( "/usr/local/bin" ) # => true # try it with a file...oops File::directory?( "file.rb" ) # => false