Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Args = { ... }
- local dirs = shell.dir()
- if Args[1] ~= nil then
- dirs = shell.resolve( Args[1] )
- end
- local all = fs.list( dirs )
- local files = {}
- local directories = {}
- for i, items in pairs ( all ) do
- local path = fs.combine( dirs, items )
- if fs.isDir( path ) then
- table.insert( directories, items )
- else
- table.insert( files, items )
- end
- end
- table.sort( directories )
- table.sort( files)
- if term.isColor() then
- textutils.pagedTabulate( colors.blue, directories, colors.yellow, files )
- else
- textutils.pagedTabulate( directories, files )
- end
Advertisement
Add Comment
Please, Sign In to add comment