Difference between revisions of "File"
m (1 revision: Importing from potato (again).) |
(Added explanation for parentheses.) |
||
Line 1: | Line 1: | ||
− | |||
Represents an file on the filesystem. | Represents an file on the filesystem. | ||
== Functions == | == Functions == | ||
+ | These functions have parentheses in odd places. This is because the ''File:'' namespace is reserved in Mediawiki. | ||
{{#ask: [[Category:Functions]] [[parent::File]] | {{#ask: [[Category:Functions]] [[parent::File]] | ||
| headers=hide | | headers=hide |
Revision as of 17:14, 14 February 2010
Represents an file on the filesystem.
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 |
(File):flush | Flushes any buffered written data in the file to disk. |
(File):getBuffer | Gets the buffer mode of a file. |
(File):getFilename | Gets the filename that the File object was created with. |
(File):getMode | Gets the FileMode the file has been opened with. |
(File):getSize | Returns the file size. |
(File):isEOF | Gets whether end-of-file has been reached. |
(File):isOpen | Gets whether the file is open. |
(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. |
(File):tell | Returns the position in the file. |
(File):write | Write data to a file. |
Enums
BufferMode | Buffer modes for File objects. |
FileMode | The different modes you can open a File in. |