2005-01-11 20:58:13 +00:00
|
|
|
#!/usr/local/plan9/bin/rc
|
2004-04-25 20:30:47 +00:00
|
|
|
|
2004-04-25 20:31:28 +00:00
|
|
|
# Click on an acme directory window and then execute Getdir
|
|
|
|
|
2005-01-14 05:55:09 +00:00
|
|
|
. 9.rc
|
2004-04-25 20:30:47 +00:00
|
|
|
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
|
2005-01-17 21:27:52 +00:00
|
|
|
|
2005-09-13 00:13:10 +00:00
|
|
|
ls -pF `{eval echo $tag(1)} | sed 's/\*$//' |
|
2005-01-14 05:55:09 +00:00
|
|
|
grep -v '^''?\.|\.o$|^''?o\.' |
|
2005-01-17 21:27:52 +00:00
|
|
|
mc |
|
|
|
|
wr data
|
2004-04-25 20:30:47 +00:00
|
|
|
echo -n '#0' | wr addr
|
|
|
|
echo -n 'dot=addr' | wr ctl
|