Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- FILE MANAGER (C) lego11 2020 - An ATARI GEM Product
- local basedir = "/data"
- function clear()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function colore(colore)
- term.setTextColor(colore)
- end
- function sfondo(colore)
- term.setBackgroundColor(colore)
- end
- function lista_dir(dir)
- local tab_f = fs.list(dir)
- sfondo(colors.black)
- local x = 2
- local y = 3
- if dir ~= "/" then
- term.setCursorPos(x, y)
- sfondo(colors.yellow)
- colore(colors.red)
- term.write("Liv. sup.")
- sfondo(colors.black)
- end
- for key, value in ipairs(tab_f) do
- if fs.isDir(value) == true then
- term.setCursorPos(x, y)
- sfondo(colors.yellow)
- colore(colors.green)
- y = y + 2
- term.setCursorPos(x, y)
- term.write(value)
- sfondo(colors.black)
- else
- term.setCursorPos(x, y)
- sfondo(colors.yellow)
- colore(colors.blue)
- y = y + 2
- term.setCursorPos(x, y)
- term.write(value)
- sfondo(colors.black)
- end
- if y > 10 then
- x = 13
- y = 3
- end
- end
- end
- clear()
- sfondo(colors.gray)
- colore(colors.white)
- print("Menu FILE MANAGER Esci")
- lista_dir("/data/")
- term.setCursorPos(20, 20)
Advertisement
Add Comment
Please, Sign In to add comment