File

Represents a file on the filesystem. A function that takes a file path can also take a File.

Constructors

love.filesystem.newFile Creates a new File object.

Functions

These functions have parentheses in odd places. This is because the File: namespace is reserved in Mediawiki.

(File):close Closes a File.
(File):eof If the end-of-file has been reached 0.10.0
(File):flush Flushes any buffered written data in the file to disk. 0.9.0
(File):getBuffer Gets the buffer mode of a file. 0.9.0
(File):getFilename Gets the filename that the File object was created with. 0.10.0
(File):getMode Gets the FileMode the file has been opened with. 0.9.0
(File):getSize Returns the file size.
(File):isEOF Gets whether end-of-file has been reached. 0.10.0
(File):isOpen Gets whether the file is open. 0.9.0
(File):lines Iterate over all the lines in a file.
(File):open Open the file for write, read or append.
(File):read Read a number of bytes from a file
(File):seek Seek to a position in a file
(File):setBuffer Sets the buffer mode for a file opened for writing or appending. 0.9.0
(File):tell Returns the position in the file
(File):write Write data to a file.
Object:type Gets the type of the object as a string.
Object:typeOf Checks whether an object is of a certain type.

Enums

BufferMode Buffer modes for File objects. 0.9.0
FileMode The different modes you can open a File in.

Supertypes

See Also


(File):isEOF

(File):isEOF Available since LÖVE 0.10.0 It has been renamed from

2017-03-21 15:40:27
(File):tell

(File):tell Returns the position in the file Function Synopsis pos

2017-03-21 15:40:30
(File):open

(File):open Open the file for write, read or append. Function Synopsis

2017-03-21 15:40:29
(File):write

(File):write Write data to a file. Function Synopsis success

2017-03-21 15:40:31
(File):getMode

(File):getMode Available since LÖVE 0.9.0 This function is not supported in earlier versions. Gets the

2017-03-21 15:40:26
(File):getBuffer

(File):getBuffer Available since LÖVE 0.9.0 This function is not supported in earlier versions. Gets the buffer mode of a file.

2017-03-21 15:40:26
(File):flush

(File):flush Available since LÖVE 0.9.0 This function is not supported in earlier versions. Flushes any buffered written data in the file to

2017-03-21 15:40:25
(File):getFilename

(File):getFilename Available since LÖVE 0.10.0 This function is not supported in earlier versions. Gets the filename that the File object was

2017-03-21 15:40:26
(File):seek

(File):seek Seek to a position in a file Function Synopsis success

2017-03-21 15:40:29
(File):getSize

(File):getSize Returns the file size. Function Synopsis

2017-03-21 15:40:27