getf
const func string: getf (in string: file_name)
-
Read the file with the given 'file_name' into a string.
Getf returns all bytes of a file without any change.
- Returns:
- a string with the file content, or "" if no file exists.
putf
const proc: putf (in string: file_name, in string: stri)
-
Write the string 'stri' to the file with the name 'file_name'.
If the file exists already, it is overwritten.
readf
const func array string: readf (in string: file_name)
-
Read the file with the name 'file_name' into an array of strings.
The function accepts lines ending with LF or with CR LF. The line
endings are not copied into the strings. The last line of the
file needs not to be terminated with a LF.
- Returns:
- a string array with the file content, or an empty array if no file exists.
writef
const proc: writef (in string: file_name, in array string: data)
-
Write the string array 'data' to the file with the name 'file_name'.
The elements of the array are written as lines to the file. The
function uses LF as line ending and the last line is also
terminated with a LF. If the file exists already, it is
overwritten.