Lutro - Documentation

love.filesystem

Provides an interface to the user's filesystem.

love.filesystem.exists

Check whether a file or directory exists.

exists = love.filesystem.exists(filename)

love.filesystem.read

Read the contents of a file.

contents, size = love.filesystem.read(name, size)

love.filesystem.write

Write data to a file.

success, message = love.filesystem.write(name, data, size)

love.filesystem.setRequirePath

Sets the filesystem paths that will be searched when require is called.

love.filesystem.setRequirePath(paths)

love.filesystem.getRequirePath

Gets the filesystem paths that will be searched when require is called.

paths = love.filesystem.getRequirePath()

love.filesystem.load

Loads a Lua file (but does not run it).

chunk, errormsg = love.filesystem.load(name)

love.filesystem.setIdentity

Sets the write directory for your game.

love.filesystem.setIdentity(name)

love.filesystem.getUserDirectory

Returns the path of the user's directory.

path = love.filesystem.getUserDirectory()

love.filesystem.isDirectory

Check whether something is a directory.

isDir = love.filesystem.isDirectory(filename)

love.filesystem.isFile

Check whether something is a file.

isFile = love.filesystem.isFile(filename)

love.filesystem.createDirectory

Creates a directory.

success = love.filesystem.createDirectory(name)

love.filesystem.getDirectoryItems

Returns all the files and subdirectories in the directory.

files = love.filesystem.getDirectoryItems(dir)