Problem with love.filesystem
Posted: Mon Apr 04, 2016 5:10 pm
Hi,
i try to write a string into a txt file with love.filesystem:
My Problem is that this won't work, the txt file is still empty.
What is wrong with this code?
I hope you can help me.
Brian
i try to write a string into a txt file with love.filesystem:
Code: Select all
function love.load()
file = love.filesystem.newFile("cool.txt")
file:open("w")
for x = 1, 5 do file:write("This is cool line number "..x) end
file:close()
end
function love.draw()
love.graphics.print("Done!", 0, 10)
end
What is wrong with this code?
I hope you can help me.
Brian