In article <CfxK7.298951$Lg.13741816 / sjcpnn01.usenetserver.com>,
Phil Tomson <ptkwt / shell1.aracnet.com> wrote:
>In article <8D96EDA0AC04D31197B400A0C96C148003C04752 / ossex1.corp.webb.net>,
>Ben Schumacher  <BSchumacher / jabber.com> wrote:
>>I was wondering if somebody had an easy way of checking if a file exists on
>>a filesystem without using begin/rescue. I might be making this too
>>complicated on myself, but I can't seem to find any other way. I was hopign
>>there was something like a "File.exists" or similar.
>>
>
>if FileTest.exists?("filename")
>   #read it
>else
>   #it doesn't exist so don't try to read it
>end
>

Actually, the FileTest module is mixed-in to File so you can also do:

File.exists?("filename")

Phil