* [9fans] watch command
@ 2005-04-19 6:17 YAMANASHI Takeshi
2005-04-19 6:37 ` Kenji Okamoto
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: YAMANASHI Takeshi @ 2005-04-19 6:17 UTC (permalink / raw)
To: 9fans
I read about "watch" command in the mpx paper (*) and thought
it's interesting. The paper mentions the commandline:
watch fig1.pic | pic | troff | proof
and the pipe line runs whenever fig1.pic is modified.
Does anyone have a similar program in his pocket?
(*) hget http://cm.bell-labs.com/cm/cs/doc/83/mpx.ps.gz | gunzip | page
I'm thinking of writing a file server (watchfs) which will serve:
/n/watch/ctl
/n/watch/data/a.c
/n/watch/data/b.c
Whenever a.c and b.c are changed, a text will appear on the ctl file.
Thus, you can do something like:
% while(){read /n/watch/ctl; mk}
How's this idea?
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] watch command
2005-04-19 6:17 [9fans] watch command YAMANASHI Takeshi
@ 2005-04-19 6:37 ` Kenji Okamoto
2005-04-19 8:35 ` Fco. J. Ballesteros
2005-04-19 12:03 ` [SPAM] " vdharani
2 siblings, 0 replies; 6+ messages in thread
From: Kenji Okamoto @ 2005-04-19 6:37 UTC (permalink / raw)
To: 9fans
> Whenever a.c and b.c are changed, a text will appear on the ctl file.
> Thus, you can do something like:
> % while(){read /n/watch/ctl; mk}
>
> How's this idea?
I've heard a Japanese talked on automatic counting of craters, where
it can, probably, recognise the crater right(?), actually which is the
problem here. By the way, he is a programmer probably, and not a
Planetary geologist, and had thought it might be usefull. Is it usefull?
No.
In your example, are you going to have a huge list of files to be watched?
Kenji
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] watch command
2005-04-19 6:17 [9fans] watch command YAMANASHI Takeshi
2005-04-19 6:37 ` Kenji Okamoto
@ 2005-04-19 8:35 ` Fco. J. Ballesteros
2005-04-19 12:03 ` [SPAM] " vdharani
2 siblings, 0 replies; 6+ messages in thread
From: Fco. J. Ballesteros @ 2005-04-19 8:35 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
This is how we do it.
POLL(1) Plan B — 3rd edition POLL(1)
NAME
poll - poll files for changes
SYNOPSIS
poll [ -1 ] [ -i ival ] cmd file...
DESCRIPTION
Poll monitors the given files each ival seconds (one by
default) and runs cmd when any of the files change. It uses
fstat(2) to generate a single stat(5) request for each poll
and file. If -1 is given, the program exits after the first
change noticed; otherwise, it keeps on polling the files.
The command is assumed to be at /bin and is executing using
the list of files as arguments.
SOURCE
/sys/src/cmd/poll.c
Page 1 Plan B User's Manual (printed 4/19/05)
[-- Attachment #2: Type: message/rfc822, Size: 3182 bytes --]
From: YAMANASHI Takeshi <9.nashi@gmail.com>
To: 9fans@cse.psu.edu
Subject: [9fans] watch command
Date: Tue, 19 Apr 2005 15:17:29 +0900
Message-ID: <fba2c2927e6c4dd58cd8a6ebd5ec1d86@orthanc.cc.titech.ac.jp>
I read about "watch" command in the mpx paper (*) and thought
it's interesting. The paper mentions the commandline:
watch fig1.pic | pic | troff | proof
and the pipe line runs whenever fig1.pic is modified.
Does anyone have a similar program in his pocket?
(*) hget http://cm.bell-labs.com/cm/cs/doc/83/mpx.ps.gz | gunzip | page
I'm thinking of writing a file server (watchfs) which will serve:
/n/watch/ctl
/n/watch/data/a.c
/n/watch/data/b.c
Whenever a.c and b.c are changed, a text will appear on the ctl file.
Thus, you can do something like:
% while(){read /n/watch/ctl; mk}
How's this idea?
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPAM] [9fans] watch command
2005-04-19 6:17 [9fans] watch command YAMANASHI Takeshi
2005-04-19 6:37 ` Kenji Okamoto
2005-04-19 8:35 ` Fco. J. Ballesteros
@ 2005-04-19 12:03 ` vdharani
2005-04-19 14:52 ` Ronald G. Minnich
2 siblings, 1 reply; 6+ messages in thread
From: vdharani @ 2005-04-19 12:03 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
> I read about "watch" command in the mpx paper (*) and thought
> it's interesting. The paper mentions the commandline:
> watch fig1.pic | pic | troff | proof
> and the pipe line runs whenever fig1.pic is modified.
> Does anyone have a similar program in his pocket?
>
> (*) hget http://cm.bell-labs.com/cm/cs/doc/83/mpx.ps.gz | gunzip | page
>
>
> I'm thinking of writing a file server (watchfs) which will serve:
> /n/watch/ctl
> /n/watch/data/a.c
> /n/watch/data/b.c
>
> Whenever a.c and b.c are changed, a text will appear on the ctl file.
> Thus, you can do something like:
> % while(){read /n/watch/ctl; mk}
>
i dont think it will work.
let us say i just saved an intermediate version of a.c while doing a
bigger change. then the above script will kick mk process that is neither
needed nor useful. the same is the case when i save a.c but i need to
change 10 other files to reflect the change in all relevant files.
thanks
dharani
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPAM] [9fans] watch command
2005-04-19 12:03 ` [SPAM] " vdharani
@ 2005-04-19 14:52 ` Ronald G. Minnich
0 siblings, 0 replies; 6+ messages in thread
From: Ronald G. Minnich @ 2005-04-19 14:52 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
On Tue, 19 Apr 2005 vdharani@infernopark.com wrote:
> >
> > Whenever a.c and b.c are changed, a text will appear on the ctl file.
> > Thus, you can do something like:
> > % while(){read /n/watch/ctl; mk}
> >
> i dont think it will work.
>
> let us say i just saved an intermediate version of a.c while doing a
> bigger change. then the above script will kick mk process that is neither
> needed nor useful. the same is the case when i save a.c but i need to
> change 10 other files to reflect the change in all relevant files.
>
the specific example may not be useful but ... you have no idea how many
times people want this stuff.
But what about a file that the server can provide that provides info about
metadata changes, i.e. you are reading a
/srv/fsstatus
and as things change you get twstat messages?
ron
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPAM] [9fans] watch command
@ 2005-04-19 6:47 YAMANASHI Takeshi
0 siblings, 0 replies; 6+ messages in thread
From: YAMANASHI Takeshi @ 2005-04-19 6:47 UTC (permalink / raw)
To: 9fans
> let us say i just saved an intermediate version of a.c while doing a
> bigger change. then the above script will kick mk process that is neither
> needed nor useful.
sounds reasonable. I wonder what was the experience in the original
watch command about intermediate modifications...
In my case, I might be going to just ignore the mk error messages
for such mk run. :)
--
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-19 14:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-19 6:17 [9fans] watch command YAMANASHI Takeshi
2005-04-19 6:37 ` Kenji Okamoto
2005-04-19 8:35 ` Fco. J. Ballesteros
2005-04-19 12:03 ` [SPAM] " vdharani
2005-04-19 14:52 ` Ronald G. Minnich
2005-04-19 6:47 YAMANASHI Takeshi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).