Page 1 of 1

Filesystem issues.

Posted: Thu Oct 30, 2014 9:47 pm
by nullbear
Not sure if i should be posting this in this board, or the other one, or what to call this even, but anyways...

I have a VERY simple love file, the contents are a main.lua file, who's code is just:

love.filesystem.write("options.cfg", "test")

Nothing happens.

I've attempted a few variations, including adding the third argument: all and changing the path to "/options.cfg" and still, no go. How do i go about making a file in the same directory as the .love file?

Re: Filesystem issues.

Posted: Thu Oct 30, 2014 9:53 pm
by Jasoco
I wouldn't recommend that. Let Löve put its file where it wants to. Which is in your AppData folder on Windows or the Library/Application Support/ folder on OS X. It's generally not recommended to dive into the os.* functions in Löve since they A) can change at any time and B) work differently across platforms.

Is there a reason you want to put it in the same directory? I can't think of any reason you can't just store any data in the proper location.

Re: Filesystem issues.

Posted: Thu Oct 30, 2014 11:52 pm
by nullbear
Ey, that was all i needed to know. The wiki doesnt say, at least from what i saw, that it will save files to app data.

Re: Filesystem issues.

Posted: Fri Oct 31, 2014 12:20 am
by Jasoco
Here you go:

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

Explains everything including where the files will be put.
Windows XP: C:\Documents and Settings\user\Application Data\LOVE\ or %appdata%\LOVE\
Windows Vista and 7: C:\Users\user\AppData\Roaming\LOVE or %appdata%\LOVE\
Linux: $XDG_DATA_HOME/love/ or ~/.local/share/love/
Mac: /Users/user/Library/Application Support/LOVE/

It is recommended to set your game's identity first in your conf.lua. You can set it with love.filesystem.setIdentity() as well.
By setting the identity, you give a name to the folder the files will go in.