Version: 4.2.1
3.1 Batch Input/Output: "batch-io.ss"
(require 2htdp/batch-io) |
The batch-io teachpack introduces two functions: read-file and write-file. It facilitates the reading and writing of entire files in one batch.
(read-file f) → string? |
f : (and/c string? file-exists?) |
reads the content of file f, located in the samd folder
(directory) as the program, and produces it as a string. If f
doesn’t exist, the function signals an error.
(write-file f cntnt) → boolean? |
f : string? |
cntnt : string? |