Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- VFS helper and moumting manager
- Author: Wassil Janssen a.k.a. Creator
- ]]--
- --Variables
- local mounts = {}
- --Functions
- function mount(destination,path)
- local tabl,dir = makeTable(destination,mounts)
- print(tabl)
- print(dir)
- end
- local function makeTable(path,tabl)
- if type(path) ~= "string" then error("Expected string, got "..type(path).."!",2) end
- if type(tabl) ~= "table" then error("Expected table, got "..type(path).."!",2) end
- path = fs.combine("",path)
- local first = path:sub(1,path:find("/") or -1)
- if not tabl[first] then tabl[first] = {} end
- if first == path then
- return tabl, first
- else
- return makeTable(path:sub(path:find("/")+1,-1),tabl[first])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement