Difference between revisions of "(File):read"

Line 3: Line 3:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
contents = File:read( bytes )
+
contents, size = File:read( bytes )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
Line 9: Line 9:
 
=== Returns ===
 
=== Returns ===
 
{{param|string|contents|The contents of the read bytes}}
 
{{param|string|contents|The contents of the read bytes}}
 +
{{param|number|size|How many bytes have been read}}
 
== See Also ==
 
== See Also ==
 
* [[parent::File]]
 
* [[parent::File]]

Revision as of 15:25, 12 December 2012

Read a number of bytes from a file

Function

Synopsis

contents, size = File:read( bytes )

Arguments

number bytes (all)
The number of bytes to read

Returns

string contents
The contents of the read bytes
number size
How many bytes have been read

See Also


Other Languages