Does file exist?
- exists?
if ARGV.size != 1
puts "Need a filename on the command line"
exit 1
end
filename = ARGV[0]
if File.exists?(filename)
puts "Exists"
else
puts "Does NOT exist"
end
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
if ARGV.size != 1
puts "Need a filename on the command line"
exit 1
end
filename = ARGV[0]
if File.exists?(filename)
puts "Exists"
else
puts "Does NOT exist"
end