Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to check whether a directory exist or not in Ruby?



How to check whether a directory exist or not in Ruby?..

Answer / 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

More Ruby Interview Questions

What is the difference between a statement and an expression in ruby?

1 Answers  


What are the case statement in ruby?

1 Answers  


What is ruby methods?

1 Answers  


What is retry statement in ruby?

1 Answers  


Tell me what is the difference between active support's “hashwithindifferent” and ruby's “hash” ?

1 Answers  


Explain each of the following operators and how and when they should be used: ==, ===, eql?, Equal?

1 Answers  


what the difference is between false and nil in Ruby?

1 Answers  


Explain the difference in scope for these two variables: @@name and @name?

1 Answers  


How to open a file in Ruby?

1 Answers  


What is yield in ruby?

1 Answers  


What must you do first before you can invoke an unboundmethod object?

1 Answers  


What are the looping structures available in ruby?

1 Answers  


Categories