aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index fd49e8c22..9f92aba99 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2380,6 +2380,10 @@ Strings that need to be translated can contain several escapes, preceded by `@`.
* nil: return all entries,
* true: return only subdirectory names, or
* false: return only file names.
+* `minetest.safe_file_write(path, content)`: returns boolean indicating success
+ * Replaces contents of file at path with new contents in a safe (atomic) way.
+ Use this instead of below code when writing e.g. database files:
+ `local f = io.open(path, "wb"); f:write(content); f:close()`
* `minetest.get_version()`: returns a table containing components of the
engine version. Components:
* `project`: Name of the project, eg, "Minetest"