Version 0.3.2
LÖVE Documentation
OverviewLicenseCreditsInstallingGetting started
Devices
love.graphicslove.audiolove.keyboardlove.mouselove.filesystemlove.timerlove.system
Types
AnimationColorFontFileImageMusicParticleSystemSound
Callbacks
loadupdatedrawmousepressedmousereleasedkeypressedkeyreleased
Miscellaneous
ConstantsConfig filesKeyboard shortcuts
Device
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.
Each game is granted a single diretory on the user system where files can be saved. Full access to normal file I/O is no longer present due to security concerns. The directories will typically be something like:
  • C:\Documents and Settings\user\.love\game
  • /home/user/.love/game
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 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.