Help with saving files

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
LuaMaster
Prole
Posts: 13
Joined: Tue Jan 01, 2013 2:33 am

Help with saving files

Post 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
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Help with saving files

Post 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.
LuaMaster
Prole
Posts: 13
Joined: Tue Jan 01, 2013 2:33 am

Re: Help with saving files

Post by LuaMaster »

I looked at that and it didn't help
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Help with saving files

Post 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?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Help with saving files

Post 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)
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests