mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +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 = {}
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user