-
Notifications
You must be signed in to change notification settings - Fork 1
FileRead
ricardoboss edited this page Sep 13, 2023
·
1 revision
The fileRead
function takes a files path as a string and returns the contents of the file as a string or null
if the
file does not exist.
fileRead(string path)
-
path
is the path to a file or a link/junction to a file.
- If the file specified in
path
does not exist,null
is returned. - If the file contains binary data the data is decoded as ASCII and returned as a string (so
\u09
is interpreted as an HTAB character) - If the file cannot be opened (e.g. because it is in use by another program),
null
is returned
hello.txt
Hello World!
This is a sample text file.
main.step
string contents = fileRead("hello.txt")
println(contents) // "Hello World!\n\n..."
© 2023 Ricardo Boss • Licensed under MIT • Want to update this page? Edit it on GitHub and submit a pull request!