love.filesystem
This module provides access to Files in two places, and two places only:
- The root folder of the .love-file. (Alternatively a directory).
- The root folder of the save directory.
- C:\Documents and Settings\user\.love\game
- /home/user/.love/game
Files that are opened for read will be looked for in the game root folder, and then the save directory (in that order). So if a file with a certain filename (and path) exist in both the .love-file and the save folder, the one in the .love-file takes precedence.
Functions
newFile( filename ) | Creates a new File for reading. |
newFile( filename, mode ) | Creates a new File. |
require( filename ) | Includes and runs a Lua file (once). |
include( filename ) | Includes and runs a Lua file. |
exists( filename ) | Checks if a file (or directory) exists. |
isDirectory( filename ) | Checks to see if a file really is a directory. |
isFile( filename ) | Checks to see if a file really is a file. |
enumerate( filename ) | Gets a list of element in a directory. |
mkdir( filename ) | Creates a directory. |
remove( filename ) | Deletes a file or directory. |
open( file ) | Opens a file. |
close( file ) | Closes a file. |
read( file ) | Reads all data from an open File. |
read( file, count ) | Reads data from an open File. |
write( file, data ) | Writes data to an open File. |
seek( file, pos ) | Seeks to a specified position in the file. |
tell( file ) | Gets the current pen position in a File. |
eof( file ) | Checks if end of file is reached. |