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.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.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.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.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.setRequirePath

love.filesystem.setRequirePath Available since LÖVE 0.10.0 This function is not supported in earlier versions. Sets the filesystem paths that will be searched when require is called. The paths string given to this function is a sequence of path templates separated by semicolons. The argument passed to require will be inserted in place of any question mark ("?") character in each template (after the dot characters in the argument passed to require are replaced by directory separators.) The

love.filesystem.setSource

love.filesystem.setSource Sets the source of the game, where the code is present. This function can only be called once, and is normally automatically done by LÖVE. Function Synopsis love.filesystem.setSource( path ) Arguments string path Absolute path to the game's source folder. Returns Nothing. See Also love.filesystem

love.filesystem.setSymlinksEnabled

love.filesystem.setSymlinksEnabled Available since LÖVE 0.9.2 This function is not supported in earlier versions. Sets whether love.filesystem follows symbolic links. It is enabled by default in version 0.10.0 and newer, and disabled by default in 0.9.2. Function Synopsis love.filesystem.setSymlinksEnabled( enable ) Arguments boolean enable Whether love.filesystem should follow symbolic links. Returns Nothing. See Also love.filesystem love.filesystem.areSymlinksEnabled love.filesy

love.filesystem.unmount

love.filesystem.unmount Available since LÖVE 0.9.0 This function is not supported in earlier versions. Unmounts a zip file or folder previously mounted for reading with love.filesystem.mount. Function Synopsis success = love.filesystem.unmount( archive ) Arguments string archive The folder or zip file in the game's save directory which is currently mounted. Returns boolean success True if the archive was successfully unmounted, false otherwise. Examples Mount a zip file and then unmo

love.filesystem.write

love.filesystem.write Write data to a file in the save directory. If the file existed already, it will be completely replaced by the new contents. Function Synopsis success = love.filesystem.write( name, data, size ) Arguments string name The name (and path) of the file. string data The string data to write to the file. number size (all) How many bytes to write. Returns boolean success If the operation was successful. Function Synopsis success = love.filesystem.write( name, data, size