Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function loadApis()
- local apis = fs.list("/CC-DOS/apis/")
- for k,v in pairs(apis) do
- os.loadAPI("/CC-DOS/apis/"..v)
- end
- end
- local args = {...}
- local cwd = sys.getcache("sys").current_path
- local drive = {}
- local drives = storage.getDrives()
- if #args == 1 then
- cwd = args[1]
- end
- for k,v in pairs(drives) do
- if v.NAME == sys.getcache("sys").current_drive then
- drive = v
- break
- end
- end
- print(" Volume in drive "..sys.getcache("sys").current_drive.." is "..drive.LABEL)
- print(" Directory of "..sys.getcache("sys").current_drive..":\\"..cwd.."\n")
- local raw = fs.list(utils.dosPathToUnixPath(sys.getcache("sys").current_drive..":\\"..cwd))
- local contents = {}
- for k,v in pairs(raw) do
- if fs.isDir(v) then
- contents[#contents+1] = "<DIR> "..v
- end
- end
- for k,v in pairs(raw) do
- if not fs.isDir(v) then
- contents[#contents+1] = " "..fs.getSize(v).." "..v
- end
- end
- for k,v in pairs(contents) do
- print(v)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement