Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --]] get file system [[--
- local tArgs = { ... }
- local _system = {}
- if(fs.isDir("vhd") and tArgs ~= "vhd")then error("Please Unload VHD Before Continuing.") end
- -- ]] precaution for dirs [[ --
- function getFileCont(dr)
- for k, v in pairs(fs.list(dr)) do
- if(fs.isDir(dr.."/"..v) and not fs.isReadOnly(dr.."/"..v))then
- getFileCont(dr..v.."/")
- else
- print(dr..v)
- if(not fs.isReadOnly(dr..v))then
- f = fs.open(dr..v,"r")
- _system[dr..v] = {content = f.readAll()}
- f.close()
- end
- end
- end
- end
- if(not tArgs[2])then
- getFileCont("")
- else
- getFileCont(tArgs[2].."/")
- end
- if(#tArgs < 1)then error("Ussage: createhdd <export file> [optional]<directory>") end
- local exp = tArgs[1]
- f = fs.open(exp,"w")
- f.write(textutils.serialize(_system))
- f.close()
- print("System Exported To: "..exp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement