Difference between revisions of "(File):write"
m (Added some see also's) |
|||
Line 22: | Line 22: | ||
== See Also == | == See Also == | ||
* [[parent::File]] | * [[parent::File]] | ||
+ | * [[(File):flush|File:flush]] | ||
+ | * [[(File):setBuffer|File:setBuffer]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
{{#set:Description=Write data to a file}} | {{#set:Description=Write data to a file}} |
Revision as of 18:46, 11 August 2013
Write data to a file
Function
Synopsis
success = File:write( data, size )
Arguments
Returns
boolean success
- Whether the operation was successful
Notes
Writing to multiple lines: Use the escape characters \r\n in combination to move to the next line for writing. If only \n is used most text editors will show the line breaks properly while some (like Notepad for Windows) will not. It seems \r\n is a safe default.
--example
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
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info