mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
add file.path(...), file.join(...)
This commit is contained in:
parent
e70746ae43
commit
9286f297c1
1 changed files with 12 additions and 0 deletions
|
|
@ -551,3 +551,15 @@ function file.parent(path)
|
||||||
end
|
end
|
||||||
return path:sub(0, pos-1)
|
return path:sub(0, pos-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function file.path(path)
|
||||||
|
local pos = path:find(':')
|
||||||
|
return path:sub(pos + 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
function file.join(a, b)
|
||||||
|
if a[#a] == ':' then
|
||||||
|
return a .. b
|
||||||
|
end
|
||||||
|
return a .. "/" .. b
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue