Hi,
I want to proof if a File exsist. I just realize this by
if(Dir.glob(file).length == 0)
But I think there should be a better possibiliti like
File.exsists?(file)
Jonathan
Hi,
I want to proof if a File exsist. I just realize this by
if(Dir.glob(file).length == 0)
But I think there should be a better possibiliti like
File.exsists?(file)
Jonathan
Jonathan H. wrote:
Hi,
I want to proof if a File exsist. I just realize this by
if(Dir.glob(file).length == 0)
But I think there should be a better possibiliti like File.exsists?(file)
You’re close. Check the docs:
robert
On 7/31/06, Jonathan H. [email protected] wrote:
Hi,
I want to proof if a File exsist. I just realize this by
if(Dir.glob(file).length == 0)
But I think there should be a better possibiliti like File.exsists?(file)
Actually it’s File.exist?(file). There’s a whole slew of these file
tests, such as File.directory?, File.readable?, File.writable? and so
on. Have a look at the documentation here:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs