Difference between revisions of "File"

m
Line 8: Line 8:
 
== Functions ==
 
== Functions ==
 
These functions have parentheses in odd places. This is because the ''File:'' namespace is reserved in Mediawiki.
 
These functions have parentheses in odd places. This is because the ''File:'' namespace is reserved in Mediawiki.
{{#ask: [[Category:Functions]] [[parent::File]] OR [[parent::Object]]
+
{{#ask: [[Category:Functions]] [[parent::File]]
 +
| headers=hide
 +
| ?Description
 +
}}
 +
{{#ask: [[Category:Functions]] [[parent::Object]]
 
| headers=hide
 
| headers=hide
 
| ?Description
 
| ?Description

Revision as of 01:47, 13 February 2011

Represents a file on the filesystem.

Constructors

love.filesystem.newFileCreates a new File object.
love.filesystem.openFileOpens a new File object, which represents an existing or new file on disk.

Functions

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

(File):closeCloses a File.
(File):eofIf the end-of-file has been reached
(File):flushFlushes any buffered written data in the file to disk.
(File):getBufferGets the buffer mode of a file.
(File):getFilenameGets the filename that the File object was created with.
(File):getModeGets the FileMode the file has been opened with.
(File):getSizeReturns the file size.
(File):isEOFGets whether end-of-file has been reached.
(File):isOpenGets whether the file is open.
(File):linesIterate over all the lines in a file.
(File):openOpen the file for write, read or append.
(File):readRead a number of bytes from a file
(File):seekSeek to a position in a file
(File):setBufferSets the buffer mode for a file opened for writing or appending.
(File):tellReturns the position in the file.
(File):writeWrite data to a file.
Object:releaseImmediately destroys the object's Lua reference.
Object:typeGets the type of the object as a string.
Object:typeOfChecks whether an object is of a certain type.

Enums

BufferModeBuffer modes for File objects.
FileModeThe different modes you can open a File in.

See Also

Other Languages