Page 1 of 1

Problem with love.filesystem

Posted: Mon Apr 04, 2016 5:10 pm
by brianIcke
Hi,

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
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

Re: Problem with love.filesystem

Posted: Mon Apr 04, 2016 7:48 pm
by s-ol
What operating system do you run and where are you looking for the file? It will be in AppData/love/gamename on Windows.

Re: Problem with love.filesystem

Posted: Tue Apr 05, 2016 1:55 pm
by brianIcke
It work! I din't know, that Löve is saving the files in Appdata.

Thanks!

Brian