lovr.filesystem.write

Edit

Write to a file in the save directory.



Arguments

NameTypeDescription
filenamestring The file to write to.
contentstring A string to write to the file.

Returns

NameTypeDescription
successboolean Whether the write was successful.

Arguments

NameTypeDescription
filenamestring The file to write to.
blobBlob A Blob containing data to write to the file.

Returns

NameTypeDescription
successboolean Whether the write was successful.

Notes

If the file does not exist, it is created.

If the file already has data in it, it will be replaced with the new content.

If the path contains subdirectories, all of the parent directories need to exist first or the write will fail. Use lovr.filesystem.createDirectory to make sure they're created first.

See also