Difference between revisions of "love.filesystem.newFile"

m (1 revision: Imported docs from potato.)
Line 1: Line 1:
  
 
+
Creates a new File object.
 +
It needs to be opened before it can be accessed.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 20: Line 21:
 
* [[parent::love.filesystem]]
 
* [[parent::love.filesystem]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=}}
+
{{#set:Description=Creates a new File object.
 +
}}

Revision as of 16:17, 14 February 2010

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