From: Brian Candler Date: 2010-05-14T17:41:47+09:00 Subject: Re: How to check the file is available or not. KingMaker KingMaker wrote: > How to check the file is available or not. You can do this with File.exist?("..."), but I'd do this: begin contents = File.read("c:/test/test.txt") log.debug "Text File Available.....!!!!!!!!" rescue Errno::ENOENT log.debug "File not available" break end This is technically better because it avoids a race condition (the file being deleted within the short time between when you test for its existence, and when you actually read it) -- Posted via http://www.ruby-forum.com/.