How to check whether a directory exist or not in Ruby?
Answer Posted / Preeti
In Ruby, you can use the `FileTest` module to check whether a directory exists or not. Here's an example: `if FileTest.directory?('/path/to/directory') then puts 'Directory exists.' else puts 'Directory does not exist.' end
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers