[Solved] Cant write to file

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
micheel665
Prole
Posts: 2
Joined: Tue May 26, 2015 5:18 pm

[Solved] Cant write to file

Post by micheel665 »

Every time I try and write anything to a file it doesn't do it, I'm using the example code from the wiki. I have the note.txt in my folder.

Code: Select all

function love.load()

    f = love.filesystem.newFile("note.txt")
	f:open("w")
	for i = 1, 10 do
		f:write("This is line "..i.."!\r\n")
	end
	f:close()
	
end
Last edited by micheel665 on Tue May 26, 2015 7:00 pm, edited 1 time in total.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Cant write to file

Post by Robin »

Have you checked the save directory?
Help us help you: attach a .love.
micheel665
Prole
Posts: 2
Joined: Tue May 26, 2015 5:18 pm

Re: Cant write to file

Post by micheel665 »

Robin wrote:Have you checked the save directory?
Thank you for pointing out the save directory for me, I checked in the roaming/love folder and the file with the text was there!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest