logo       

[jruby-user] Dir.mkdir and File.exists: msg#00150

lang.jruby.user

Subject: [jruby-user] Dir.mkdir and File.exists

p File.exists?('~/Documents/fake/nonexistant/directories/new_dir')
#=>false
p Dir.mkdir('~/Documents/fake/nonexistant/directories/new_dir')
#=>0
p File.exists?('~/Documents/fake/nonexistant/directories/new_dir')
#=>true
p Dir.mkdir('~/Documents/fake/nonexistant/directories/new_dir')
#=>:[-1,-1]:[0,0]: File exists -
~/Documents/fake/nonexistant/directories/new_dir (Errno::EEXIST)
p File.exists?('~/Documents/fake/nonexistant/directories/new_dir')
#=>true

If I am not mistaken, then 1st and 4th expressions are correct, the
2nd should raise an exception because the new_dir is in a directory
which doesn't exist, and the 3rd and 5th should return false

-Daniel Brumbaugh Keeney

---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise