mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 07:13:45 +01:00
Add file.split_extension
This commit is contained in:
parent
022cd1a78e
commit
4d9b7ca0aa
4
file.lua
4
file.lua
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user