(File):write

Write data to a file

Function

Synopsis

success = File:write( data )

Arguments

string data
The data to write

Returns

boolean success
Whether the operation was successful

Notes

Writing to multiple lines: On Windows, use the escape characters \r\n to move to the next line for writing. On any other OS \n alone should suffice.

--example (Windows)
f = love.filesystem.newFile("note.txt")
f:open()
for i = 1, 10 do f:write("This is line "..i.."!\r\n") end
f:close()

See Also


Other Languages