Difference between revisions of "love.filesystem.newFile"

Line 1: Line 1:
Creates a new File object.  
+
Creates a new [[File]] object.  
 
It needs to be opened before it can be accessed.
 
It needs to be opened before it can be accessed.
 
== Function ==
 
== Function ==
Line 21: Line 21:
 
* [[Constructs::File]]
 
* [[Constructs::File]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Creates a new File object.}}
+
{{#set:Description=Creates a new [[File]] object.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.filesystem.newFile}}
 
{{i18n|love.filesystem.newFile}}

Revision as of 16:25, 28 March 2011

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 to read.

Returns

File file
The new File object.

Examples

Open a file and read everything

file = love.filesystem.newFile("data.txt")
file:open('r')
data = file:read()

See Also


Other Languages