Read entire file: Difference between revisions
m
→{{header|Julia}}
Line 997:
=={{header|Julia}}==
The built-in function <code>read</code>, when used with a second argument of String, reads the whole file named by its first argument into a string (assuming UTF8 encoding).
Alternatively, for files that are too large to read into memory without swapping, there are a variety of ways to memory-map the file,
▲<lang Julia>readstring("/devel/myfile.txt") # read file into a string
▲Alternatively, there are a variety of ways to memory-map the file, here as an array of bytes:
<lang Julia>A = Mmap.mmap(open("/devel/myfile.txt"), Array{UInt8,1})</lang>
|