Getdir (524B)
1 #!/usr/local/plan9/bin/rc 2 3 # Click on an acme directory window and then execute Getdir 4 5 . 9.rc 6 dir=acme/acme/$winid 7 8 fn rd { 9 9p read $dir/$1 || { echo 9p failed >[1=2]; exit 9p } 10 } 11 fn wr { 12 9p write $dir/$1 || { echo 9p failed >[1=2]; exit 9p } 13 } 14 15 16 tag=`{rd tag} 17 if(! ~ $tag(1) */){ 18 echo window $tag(1) is not a directory >[1=2] 19 exit 'not a directory' 20 } 21 22 echo -n , | wr addr 23 24 ls -pF `{eval echo $tag(1)} | sed 's/\*$//' | 25 grep -v '^''?\.|\.o$|^''?o\.' | 26 mc | 27 wr data 28 echo -n '#0' | wr addr 29 echo -n 'dot=addr' | wr ctl