aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-25 20:30:47 +0000
committerrsc <devnull@localhost>2004-04-25 20:30:47 +0000
commite06d9217697864dc04194f856eca4504c189c13d (patch)
treec3777d7a5032f6cccafeef87684f283e5cdc431d /bin
parent9471281d4201790dcfb86e202206305c0465b913 (diff)
downloadplan9port-e06d9217697864dc04194f856eca4504c189c13d.tar.gz
plan9port-e06d9217697864dc04194f856eca4504c189c13d.tar.bz2
plan9port-e06d9217697864dc04194f856eca4504c189c13d.zip
make a clean listing in an acme window.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/Getdir24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/Getdir b/bin/Getdir
new file mode 100755
index 00000000..b1646427
--- /dev/null
+++ b/bin/Getdir
@@ -0,0 +1,24 @@
+#!/usr/local/plan9/bin/rc
+
+dir=acme/acme/$winid
+
+fn rd {
+ 9p read $dir/$1 || { echo 9p failed >[1=2]; exit 9p }
+}
+fn wr {
+ 9p write $dir/$1 || { echo 9p failed >[1=2]; exit 9p }
+}
+
+
+tag=`{rd tag}
+if(! ~ $tag(1) */){
+ echo window $tag(1) is not a directory >[1=2]
+ exit 'not a directory'
+}
+
+echo -n , | wr addr
+ls -pF $tag(1) | sed 's/\*$//' |
+ 9grep -v '^\.|\.o$|^o\.' |
+mc | wr data
+echo -n '#0' | wr addr
+echo -n 'dot=addr' | wr ctl