Add file.split_extension

master
Lars Mueller 2021-09-01 17:07:26 +02:00
parent 022cd1a78e
commit 4d9b7ca0aa
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,10 @@ local io, minetest, modlib, string = io, minetest, modlib, string
local _ENV = {}
setfenv(1, _ENV)
function split_extension(filename)
return filename:match"(.*)%.(.*)$"
end
function read(filename)
local file = io.open(filename, "r")
if file == nil then return nil end