- read
- slurp
Read from file (slurp)
- Read the content of the whole file
- Raise exception File::NotFoundError if file does not exist
examples/files/read_from_file.cr
if ARGV.size != 1 puts "Need a filename on the command line" exit 1 end filename = ARGV[0] content = File.read(filename) puts content