1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Lua API: Add rmdir, cpdir and mvdir (#9638)

Co-authored-by: rubenwardy <rw@rubenwardy.com>
This commit is contained in:
Elijah Duffy 2021-11-10 10:10:20 -08:00 committed by GitHub
parent 6db914780e
commit cbf658f83d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 0 deletions

View file

@ -4624,6 +4624,19 @@ Utilities
* `minetest.mkdir(path)`: returns success.
* Creates a directory specified by `path`, creating parent directories
if they don't exist.
* `minetest.rmdir(path, recursive)`: returns success.
* Removes a directory specified by `path`.
* If `recursive` is set to `true`, the directory is recursively removed.
Otherwise, the directory will only be removed if it is empty.
* Returns true on success, false on failure.
* `minetest.cpdir(source, destination)`: returns success.
* Copies a directory specified by `path` to `destination`
* Any files in `destination` will be overwritten if they already exist.
* Returns true on success, false on failure.
* `minetest.mvdir(source, destination)`: returns success.
* Moves a directory specified by `path` to `destination`.
* If the `destination` is a non-empty directory, then the move will fail.
* Returns true on success, false on failure.
* `minetest.get_dir_list(path, [is_dir])`: returns list of entry names
* is_dir is one of:
* nil: return all entries,