> For the complete documentation index, see [llms.txt](https://vypxl.gitbook.io/scar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vypxl.gitbook.io/scar/builtin-features/util.md).

# Util

The `Scar::Util` module provides some useful methods.

### File Handling

These methods are supposed to help writing files to a local user directory.

Before using any of them, set the subdirectory inside the user directory (windows: `%appdata%\<subdir>` | linux: `~/.local/share/<dir>`) by calling `Scar::Util.dir = <dir>`.

After that, you can write and read files with the following methods:

* `write_file(name : String, content : String)`
* `write_file_bytes(name : String, content : Bytes)`
* `read_file(name) => String`
* `read_file_bytes(name) => Bytes`
