find out if it is a directory with directory?: : directory « File Directory « Ruby






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

 








Related examples in the same category

1.Is it a directory or a file