love.filesystem.setIdentity

love.filesystem.setIdentity Sets the write directory for your game. Note that you can only set the name of the folder to store your files in, not the location. Function Synopsis love.filesystem.setIdentity( name ) Arguments string name The new identity that will be used as write directory. Returns Nothing. Function Available since LÖVE 0.9.0 This variant is not supported in earlier versions. Synopsis love.filesystem.setIdentity( name, appendToPath ) Arguments string name The new ident

love.filesystem.remove

love.filesystem.remove Removes a file or empty directory. Function Synopsis success = love.filesystem.remove( name ) Arguments string name The file or directory to remove. Returns boolean success True if the file/directory was removed, false otherwise. Notes The directory must be empty before removal or else it will fail. Simply remove all files and folders in the directory beforehand. If the file exists in the .love but not in the save directory, it returns false as well. An opened Fi

love.filesystem.read

love.filesystem.read Read the contents of a file Function Synopsis contents, size = love.filesystem.read( name, size ) Arguments string name The name (and path) of the file number size (all) How many bytes to read Returns string contents The file contents number size How many bytes have been read See Also love.filesystem

love.filesystem.newFileData

love.filesystem.newFileData Creates a new FileData object. Function Synopsis data = love.filesystem.newFileData( contents, name, decoder ) Arguments string contents The contents of the file. string name The name of the file. FileDecoder decoder ("file") The method to use when decoding the contents. Returns FileData data Your new FileData. Function Available since LÖVE 0.9.0 This variant is not supported in earlier versions. Creates a new FileData from a file on the storage device.

love.filesystem.newFile

love.filesystem.newFile Creates a new File object. It needs to be opened before it can be accessed. Function Synopsis file = love.filesystem.newFile( filename ) Arguments string filename The filename of the file. Returns File file The new File object. Notes Please note that this function will not return any error message (e.g. if you use an invalid filename) because it just creates the File Object. You can still check if the file is valid by using File:open which returns a boolean and an

love.filesystem.mount

love.filesystem.mount Available since LÖVE 0.9.0 This function is not supported in earlier versions. Mounts a zip file or folder in the game's save directory for reading. Function Synopsis success = love.filesystem.mount( archive, mountpoint ) Arguments string archive The folder or zip file in the game's save directory to mount. string mountpoint The new path the archive will be mounted to. Returns boolean success True if the archive was successfully mounted, false otherwise. Functi

love.filesystem.mkdir

love.filesystem.mkdir Removed in LÖVE 0.9.0 It has been renamed to love.filesystem.createDirectory. Recursively creates a directory. When called with "a/b" it creates both "a" and "a/b", if they don't exist already. Function Synopsis ok = love.filesystem.mkdir( name ) Arguments string name The directory to create. Returns boolean ok True if the directory was created, false if not. See Also love.filesystem

love.filesystem.load

love.filesystem.load Loads a Lua file (but does not run it). Function Synopsis chunk, errormsg = love.filesystem.load( name ) Arguments string name The name (and path) of the file. Returns function chunk The loaded chunk. string errormsg (nil) The error message if file could not be opened. Example It is important to note that love.filesystem.load does not invoke the code, it just creates a function (a 'chunk') that will contain the contents of the file inside it. In order to execute the

love.filesystem.lines

love.filesystem.lines Iterate over the lines in a file. Function Synopsis iterator = love.filesystem.lines( name ) Arguments string name The name (and path) of the file Returns function iterator A function that iterates over all the lines in the file Example local highscores = {} for line in love.filesystem.lines("highscores.lst") do table.insert(highscores, line) end See Also love.filesystem

love.filesystem.isSymlink

love.filesystem.isSymlink Available since LÖVE 0.9.2 This function is not supported in earlier versions. Gets whether a filepath is actually a symbolic link. If symbolic links are not enabled (via love.filesystem.setSymlinksEnabled), this function will always return false. Function Synopsis symlink = love.filesystem.isSymlink( path ) Arguments string path The file or directory path to check. Returns boolean symlink True if the path is a symbolic link, false otherwise. See Also love