|
|
@@ -83,7 +83,7 @@ function shutil.df() -- Prints free disk space. |
|
|
|
local fstr = "%-"..tostring(ml).."s %5s %5s" |
|
|
|
print("fs"..(" "):rep(ml-2).." size used") |
|
|
|
for k,v in pairs(mt) do |
|
|
|
local st, su = fs.spaceTotal(v.."/."), fs.spaceUsed(v.."/.") |
|
|
|
local st, su = fs.spaceTotal("/"..v), fs.spaceUsed("/"..v) |
|
|
|
print(string.format(fstr,v,wrapUnits(st),wrapUnits(su))) |
|
|
|
end |
|
|
|
end |
|
|
@@ -119,18 +119,6 @@ function shutil.free() -- Displays used and free memory. |
|
|
|
print(string.format("%5s %5s %5s",wrapUnits(computer.totalMemory()),wrapUnits(computer.totalMemory()-computer.freeMemory()),wrapUnits(computer.freeMemory()))) |
|
|
|
end |
|
|
|
|
|
|
|
local function pread(self,len) |
|
|
|
syslog(tostring(self)) |
|
|
|
syslog(tostring(len)) |
|
|
|
io.input(self.input) |
|
|
|
local b = io.read(len) |
|
|
|
io.input(self) |
|
|
|
if b:match("\3") then |
|
|
|
error("terminated") |
|
|
|
end |
|
|
|
return b |
|
|
|
end |
|
|
|
|
|
|
|
function shutil.which(name) |
|
|
|
local fpath |
|
|
|
for _,dir in ipairs(os.getenv("PATH")) do |
|
|
|