Add File.exists? as a wrapper to File.stat

git-svn-id: file:///home/svn/framework3/trunk@12324 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2011-04-15 15:29:57 +00:00
parent 904e7af88b
commit 50155919ea
1 changed files with 9 additions and 1 deletions

View File

@ -96,7 +96,15 @@ Separator = "\\"
def File.stat(name)
return client.fs.filestat.new(name)
end
#
# Determines if a file exists and returns true/false
#
def File.exists?(name)
r = client.fs.filestat.new(name) rescue nil
r ? true : false
end
#
# Performs a delete on the specified file.
#