natiny_resource_save
C
int natiny_resource_save(NatinyResource resource, const char* path);
Writes a resource's bytes to a file, replacing an existing file at that path.
Parameters
| Name |
Type |
Description |
resource |
NatinyResource |
Resource handle |
path |
const char* |
Where to write it; an existing file is overwritten |
Returns
| Type |
Description |
int |
1 when every byte was written, 0 otherwise |
Example
C
int ok = natiny_resource_save(resource, "save.json");
Notes
- On web, the path is in Emscripten's virtual filesystem and normally persists
only for the current page session.