File:write

Edit

Writes data to the file.



Arguments

NameTypeDefaultDescription
stringstring A string to write to the file.
sizenumbernil The number of bytes to write, or nil to write all of the data from the string/Blob.

Returns

NameTypeDescription
successboolean Whether the data was successfully written.
messagestring The error message.

Arguments

NameTypeDefaultDescription
blobBlob The Blob containing data to write to the file.
sizenumbernil The number of bytes to write, or nil to write all of the data from the string/Blob.

Returns

NameTypeDescription
successboolean Whether the data was successfully written.
messagestring The error message.

Notes

The maximum number of bytes that can be written at a time is 2^53 - 1.

Use File:seek to control where the data is written.

See also