summaryrefslogtreecommitdiff
path: root/appl/cmd/ls.b
diff options
context:
space:
mode:
Diffstat (limited to 'appl/cmd/ls.b')
-rw-r--r--appl/cmd/ls.b14
1 files changed, 14 insertions, 0 deletions
diff --git a/appl/cmd/ls.b b/appl/cmd/ls.b
index 3d27d59e..6ffe29fb 100644
--- a/appl/cmd/ls.b
+++ b/appl/cmd/ls.b
@@ -39,6 +39,7 @@ qopt := 0;
sopt := 0;
topt := 0;
uopt := 0;
+Fopt := 0;
Topt := 0;
now: int;
sortby: int;
@@ -112,6 +113,8 @@ init(nil: ref Context, argv: list of string)
rev = Readdir->DESCENDING;
'T' =>
Topt++;
+ 'F' =>
+ Fopt++;
* =>
sys->fprint(stderr, "usage: ls [-delmnpqrstucT] [files]\n");
raise "fail:usage";
@@ -271,6 +274,8 @@ lslineprint(dirname, name: string, dir: ref Dir, w: ref Widths)
else
file = dirname + "/" + file;
}
+ if(Fopt)
+ file += fileflag(dir);
if(lopt) {
@@ -291,6 +296,15 @@ lslineprint(dirname, name: string, dir: ref Dir, w: ref Widths)
out.puts(file+"\n");
}
+fileflag(dir: ref Dir): string
+{
+ if(dir.qid.qtype & Sys->QTDIR)
+ return "/";
+ if(dir.mode & 8r111)
+ return "*";
+ return "";
+}
+
mtab := array[] of {
"---", "--x", "-w-", "-wx",
"r--", "r-x", "rw-", "rwx"