$::io -- File I/O¶
$::io::nread¶
Monadic. Reads a text file and returns its contents as a character vector.
Syntax¶
Arguments¶
⍵-- character vector containing the file path.
Result¶
A character vector with the file contents, including embedded newlines. Returns an empty vector if the file is empty.
Example¶
$::io::nwrite¶
Dyadic. Writes a character vector to a file.
Syntax¶
Arguments¶
⍺-- character vector containing the data to write.⍵-- character vector containing the file path.
Result¶
Empty vector (shape 0).
Example¶
Overwrites the file if it exists, creates it if it does not.
Implementation¶
Both functions are thin wrappers around Python file I/O, exposed via i-beam: