Is there a Ruby class/method where I could pass “a full path”, home/me/a_file.txt, to identify whether it is a valid file path?
Is there a Ruby class/method where I could pass a full path, home/me/a_file.txt ,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out Pathname and in particular
Pathname#exist?.File and its FileTest module are perhaps simpler/more direct, but I find
Pathnamea nicer interface in general.