Creates a new [[FileData]] object.

== Function ==
=== Synopsis ===
<source lang="lua">
data = love.filesystem.newFileData( contents, name )
</source>
=== Arguments ===
{{param|string|contents|The contents of the file.}}
{{param|string|name|The name of the file.}}
=== Returns ===
{{param|FileData|data|Your new FileData.}}

== Function ==
{{newin|[[0.9.0]]|090|type=variant}}
Creates a new [[FileData]] from a file on the storage device.
=== Synopsis ===
<source lang="lua">
data, err = love.filesystem.newFileData( filepath )
</source>
=== Arguments ===
{{param|string|filepath|Path to the file.}}
=== Returns ===
{{param|FileData|data|The new FileData, or [[nil]] if an error occurred.}}
{{param|string|err|The error string, if an error occurred.}}

== Function ==
{{oldin|[[11.0]]|110|type=variant|text=The variant which decodes base64 data has been replaced by [[love.data.decode]]}}
=== Synopsis ===
<source lang="lua">
data = love.filesystem.newFileData( contents, name, decoder )
</source>
=== Arguments ===
{{param|string|contents|The contents of the file.}}
{{param|string|name|The name of the file.}}
{{param|FileDecoder|decoder|The method to use when decoding the contents.}}
=== Returns ===
{{param|FileData|data|Your new FileData.}}

== See Also ==
* [[parent::love.filesystem]]
* [[Constructs::FileData]]
[[Category:Functions]]
{{#set:Description=Creates a new [[FileData]] object.}}
{{#set:Since=070}}
{{#set:PrettySince=0.7.0}}
== Other Languages ==
{{i18n|love.filesystem.newFileData}}