Add file.split_extension

This commit is contained in:
Lars Mueller 2021-09-01 17:07:26 +02:00
parent 022cd1a78e
commit 4d9b7ca0aa

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