YASL’s IO library has the following functions and constants.
| Name | Description |
|---|---|
| stdin | standard input |
| stdout | standard output |
| stderr | standard error |
| Name | Arguments | Description |
|---|---|---|
| open | name, mode? | Returns the file from opening name in mode mode. Valid modes are 'r', 'w', 'a', 'r+', 'w+', 'a+'. mode defaults to 'r' if not supplied. |
| Name | Arguments | Description |
|---|---|---|
| read | self, mode | Valid modes are 'l' and 'a'. If mode is 'l', returns the next line from self. If mode is 'a', reads and returns the entire file. |
| write | self, val | Writes val to self. |
| flush | self | Flushes self. |