mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 17:43:53 +01:00
f259f85771
....I can't believe that Lua doesn't have an inbuilt scandir equivalent?!
15 lines
364 B
Lua
15 lines
364 B
Lua
local io = {
|
|
-- Ref https://minetest.gitlab.io/minetest/minetest-namespace-reference/#utilities
|
|
scandir = function(dirpath)
|
|
return minetest.get_dir_list(dirpath, nil)
|
|
end,
|
|
scandir_files = function(dirpath)
|
|
return minetest.get_dir_list(dirpath, false)
|
|
end,
|
|
scandir_dirs = function(dirpath)
|
|
return minetest.get_dir_list(dirpath, true)
|
|
end,
|
|
}
|
|
|
|
return io
|