Atom

resource.read()

Copies one embedded or host-provided resource.

Signature

resource.read(name)

Parameters

Nonempty string resource name without embedded NUL.

Returns

Packed u8 bytes.

Behavior

Copies into managed storage. The packaged resource remains part of the executable.

Errors

Missing resource, invalid name or missing loader/module.

Example

Package this source with --resource title=title.txt as shown in Embedded assets.

Atom
use binary
use resource
print(binary.text(resource.read('title')))