add file.parent(...)

This commit is contained in:
MihailRis
2025-03-11 00:39:59 +03:00
parent 567105dfce
commit c6492b3d25
+8
View File
@@ -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