Difference between revisions of "(File):open"
(Add note what to do when this function fails) |
m (Added information about returned error message.) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | ok = File:open( mode ) | + | ok, err = File:open( mode ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
Line 9: | Line 9: | ||
=== Returns === | === Returns === | ||
{{param|boolean|ok|True on success, false otherwise.}} | {{param|boolean|ok|True on success, false otherwise.}} | ||
+ | {{param|string|err|The error string if an error occurred.}} | ||
=== Notes === | === Notes === | ||
If you are getting the error message "Could not set write directory", try setting the save directory. This is done either with [[love.filesystem.setIdentity]] or by setting the identity field in [[love.conf]] (only available with love 0.7 or higher). | If you are getting the error message "Could not set write directory", try setting the save directory. This is done either with [[love.filesystem.setIdentity]] or by setting the identity field in [[love.conf]] (only available with love 0.7 or higher). | ||
== See Also == | == See Also == | ||
* [[parent::File]] | * [[parent::File]] | ||
+ | * [[FileMode]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
{{#set:Description=Open the file for write, read or append.}} | {{#set:Description=Open the file for write, read or append.}} | ||
+ | {{#set:Since=000}} | ||
== Other Languages == | == Other Languages == | ||
{{i18n|(File):open}} | {{i18n|(File):open}} |
Latest revision as of 17:36, 16 January 2015
Open the file for write, read or append.
Function
Synopsis
ok, err = File:open( mode )
Arguments
FileMode mode
- The mode to open the file in.
Returns
Notes
If you are getting the error message "Could not set write directory", try setting the save directory. This is done either with love.filesystem.setIdentity or by setting the identity field in love.conf (only available with love 0.7 or higher).
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info