Page 1 of 1

Help with saving files

Posted: Fri Jun 07, 2013 6:12 pm
by LuaMaster
I have a few questions about saving, I am on a mac.
For number one, how do I make a file in Application Support
Two, how do I actually save?
And three, how do load

Re: Help with saving files

Posted: Fri Jun 07, 2013 6:20 pm
by Jasoco
Please check the Wiki under the filesystem section. It's a very simple thing to do.

http://www.love2d.org/wiki/love.filesystem

There's information on how to use all the filesystem commands in there. They're extremely easy to use.

Re: Help with saving files

Posted: Fri Jun 07, 2013 6:23 pm
by LuaMaster
I looked at that and it didn't help

Re: Help with saving files

Posted: Fri Jun 07, 2013 6:32 pm
by Jasoco
How did it not help? What exactly have you tried so far? It's pretty general stuff if you already know how to do most of the other Löve stuff.

Are you trying to save data from within Löve? Or are you asking how to create your .lua files?

Re: Help with saving files

Posted: Fri Jun 07, 2013 6:39 pm
by Robin
To read a file:

Code: Select all

stringwithcontents = love.filesystem.read("filename.txt")
To write a file:

Code: Select all

love.filesystem.write("filename.txt", stringwithcontents)