The folder containing the game's .love archive (or source directory), but only if specific conditions are met.

Each game is granted a single directory on the system where files can be saved through love.filesystem. This is the only directory where love.filesystem can write files. These directories will typically be found in something like:

OS

Path

Alternative

Notes

Windows XP

C:\Documents and Settings\user\Application Data\LOVE\

%appdata%\LOVE\

-

Windows Vista, 7, 8 and 10

C:\Users\user\AppData\Roaming\LOVE

%appdata%\LOVE\

-

Mac

/Users/user/Library/Application Support/LOVE/

-

-

Linux

$XDG_DATA_HOME/love/

~/.local/share/love/

-

Android

/data/user/0/org.love2d.android/files/save/

/data/data/org.love2d.android/files/save/

On Android there are various save locations. If these don't work then you can use love.filesystem.getSaveDirectory() to check.

Files that are opened for write or append will always be created in the save directory. The same goes for other operations that involve writing to the filesystem, like mkdir.

Files that are opened for read will be looked for in the save directory, and then in the .love archive (in that order). So if a file with a certain filename (and path) exist in both the .love archive and the save folder, the one in the save directory takes precedence.

Note: All paths are relative to the .love archive and save directory. (except for the get*Directory() calls)

There's bug in 0.10.0, up to 0.10.2 where any operation involving the game save directory (i.e. writing) always fail in Android Marshmallow and later versions. The workaround is to enable externalstorage configuration.