mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-17 02:15:22 +02:00
Add minetest.safe_write_file() to script API
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user