lovr.filesystem.write

Write to a file.


bytes = lovr.filesystem.write(filename, content)

Arguments

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

Returns

NameTypeDescription
bytesnumber The number of bytes written.

bytes = lovr.filesystem.write(filename, blob)

Arguments

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

Returns

NameTypeDescription
bytesnumber The number of bytes written.

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.

See also