io
Read, write, append files; read stdin.
benutzen "io".
Functions
Read, write, and append files; read lines from stdin.
| Symbol | Description | Example |
|---|---|---|
readFile(path) | Read entire file as string | benutzen "io";
print io::readFile("notes.txt"); |
writeFile(path, text) | Write file (overwrite) → bool | benutzen "io";
print io::writeFile("out.txt", "hi"); |
appendFile(path, text) | Append to file → bool | benutzen "io";
print io::appendFile("log.txt", "line\n"); |
fileExists(path) | Whether file exists | benutzen "io";
print io::fileExists("out.txt"); |
deleteFile(path) | Delete file → bool | benutzen "io";
print io::deleteFile("out.txt"); |
input(prompt?) | Read line from stdin | benutzen "io";
var name = io::input("name: "); |
inputNumber(prompt?) | Read number from stdin | benutzen "io";
var n = io::inputNumber("age: "); |