acme: add log file in acme root directory

Reading /mnt/acme/log reports a log of window create,
put, and delete events, as they happen. It blocks until the
next event is available.

Example log output:

8 new /Users/rsc/foo.go
8 put /Users/rsc/foo.go
8 del /Users/rsc/foo.go

This lets acme-aware programs react to file writes, for example
compiling code, running a test, or updating an import block.

TBR=r
R=r
https://codereview.appspot.com/89560044
This commit is contained in:
Russ Cox 2014-04-30 12:14:29 -04:00
parent 833216fef8
commit 4a3fb87264
12 changed files with 262 additions and 8 deletions

View file

@ -63,6 +63,8 @@ xfidflush(Xfid *x)
Column *c;
Xfid *wx;
xfidlogflush(x);
/* search windows for matching tag */
qlock(&row.lk);
for(j=0; j<row.ncol; j++){
@ -186,6 +188,9 @@ xfidopen(Xfid *x)
}
else{
switch(q){
case Qlog:
xfidlogopen(x);
break;
case Qeditout:
if(!canqlock(&editoutlk)){
respond(x, &fc, Einuse);
@ -300,6 +305,9 @@ xfidread(Xfid *x)
case Qindex:
xfidindexread(x);
return;
case Qlog:
xfidlogread(x);
return;
default:
warning(nil, "unknown qid %d\n", q);
break;