Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getInfo()
- if fs.isDir("disk") == false then
- printError("no disk")
- return
- end
- if fs.exists("disk/info.cfg") == false then
- printError("no signature")
- return
- end
- info = {}
- info.name=""
- info.comp=""
- info.rel=""
- info.vol=0
- info.tpb= 0
- for line in io.lines("disk/info.cfg") do
- temp = string.match(line,"%a+:")
- if temp == "Name:" then
- temp2 = string.match(line,":.+")
- info.name = string.sub(temp2,2,string.len(temp2))
- end
- if temp == "Composer:" then
- temp2 = string.match(line,":.+")
- info.comp = string.sub(temp2,2,string.len(temp2))
- end
- if temp == "Release:" then
- temp2 = string.match(line,":.+")
- info.rel = string.sub(temp2,2,string.len(temp2))
- end
- if temp == "VOL:" then
- temp2 = string.match(line,":%d+")
- info.vol = tonumber(string.sub(temp2,2,string.len(temp2)))
- end
- if temp == "TPB:" then
- temp2 = string.match(line,":%d+")
- info.tpb = tonumber(string.sub(temp2,2,string.len(temp2)))
- end
- end
- return info
- end
- --INF = getInfo()
- --print(INF.name.." by "..INF.comp)
- --print("Released "..INF.rel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement