File
File("/path/to/file.ext")%f(/path/to/file.ext)
%d(/path/to) + %f(file.ext)var file = File("file.txt") # File object
var fh = file.open_r # FileHandle object
say fh.lines # read the lines into an Arrayvar fh = File("newfile.txt").open_w
fh.say("foo") # write a newline to the file
fh.close # close the filehandleFile("file.txt").read # read the content of a file as a String (UTF-8)
File("file.txt").read(:raw) # read the content of a file as a String (RAW)Last updated