add file.parent(...)
This commit is contained in:
parent
567105dfce
commit
c6492b3d25
@ -543,3 +543,11 @@ end
|
||||
function file.prefix(path)
|
||||
return path:match("^([^:]+)")
|
||||
end
|
||||
|
||||
function file.parent(path)
|
||||
local pos = path:find("/")
|
||||
if not pos then
|
||||
return file.prefix(path)..":"
|
||||
end
|
||||
return path:sub(0, pos-1)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user