Read a number of bytes from a file.
== Function ==
=== Synopsis ===
<source lang="lua">
contents, size = File:read( bytes )
</source>
=== Arguments ===
{{param|number|bytes (all)|The number of bytes to read.}}
=== Returns ===
{{param|string|contents|The contents of the read bytes.}}
{{param|number|size|How many bytes have been read.}}

== Function ==
{{newin|[[11.0]]|110|type=variant}}
Reads the contents of a file into either a string or a [[FileData]] object.
=== Synopsis ===
<source lang="lua">
contents, size = File:read( container, bytes )
</source>
=== Arguments ===
{{param|ContainerType|container|What type to return the file's contents as.}}
{{param|number|bytes (all)|The number of bytes to read.}}
=== Returns ===
{{param|value|contents|[[FileData]] or string containing the read bytes.}}
{{param|number|size|How many bytes have been read.}}

== See Also ==
* [[parent::File]]
[[Category:Functions]]
{{#set:Description=Read a number of bytes from a file}}
{{#set:Since=000}}
== Other Languages ==
{{i18n|(File):read}}