Log In  
Follow
sl3dge

Hello everyone,

Here's my first upload to the BBS ever, it's a simple rewrite of the ls.lua util. I've always preferred using ls -al (that is usually aliased as ll) in my unix terminals and because the muscle memory is too strong, I've just remade it quickly in Picotron.

Let me know if you have any issue. I also wanted to add the 'rwx' info just as a joke, but it crowded the output a bit too much.

Just copy this code in 'll.lua' in '/appdata/system/util'

function lpad(nb, str)
	local nb_to_add = nb - #str
	local result = ""
	for k=0,nb_to_add do
		result = result.." "
	end		
	return result..str
end

cd(env().path)

local path0 = env().argv[1] or "."
path = fullpath(path0)

if (not path) then
	print("could not resolve path "..tostr(path0))
	exit(0)
end

local res=ls(path)

if (not res) then
	print("could not find path "..tostr(res))
	exit(0)
end

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=160609#p)
1
0 comments