28 lines
543 B
Lua
28 lines
543 B
Lua
utils = {}
|
|
|
|
function utils.split (str, sep)
|
|
local new_table = {}
|
|
for v in string.gmatch(str, "([^"..sep.."]+)") do
|
|
table.insert(new_table, v)
|
|
end
|
|
return new_table
|
|
end
|
|
|
|
function utils.path_create(path)
|
|
|
|
local dirs = utils.split(path, "/")
|
|
table.remove(dirs)
|
|
local tmp = "";
|
|
for i, dir in ipairs(dirs) do
|
|
tmp = tmp .. dir
|
|
print(tmp)
|
|
if not file.Exists(tmp, "DATA")
|
|
then
|
|
file.CreateDir(tmp)
|
|
end
|
|
tmp = tmp .. "/"
|
|
end
|
|
|
|
end
|
|
|
|
return utils |