From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] watch command From: "Fco. J. Ballesteros" Date: Tue, 19 Apr 2005 10:35:51 +0200 In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-fwyeovuxsrsxpdcoopukiybocs" Topicbox-Message-UUID: 3cf6d488-ead0-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-fwyeovuxsrsxpdcoopukiybocs Content-Disposition: inline Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This is how we do it. POLL(1) Plan B =E2=80=94 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) --upas-fwyeovuxsrsxpdcoopukiybocs Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by aquamar; Tue Apr 19 08:17:57 MDT 2005 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 08D7018025 for ; Tue, 19 Apr 2005 02:17:48 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id C1B7117F6A for <9fans@cse.psu.edu>; Tue, 19 Apr 2005 02:17:39 -0400 (EDT) Received: from mail.cse.psu.edu ([127.0.0.1]) by localhost (psuvax1 [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07334-01-51 for <9fans@cse.psu.edu>; Tue, 19 Apr 2005 02:17:35 -0400 (EDT) Received: from vc2.net.titech.ac.jp (vc2.net.titech.ac.jp [131.112.125.36]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 7ED4817F5E for <9fans@cse.psu.edu>; Tue, 19 Apr 2005 02:17:35 -0400 (EDT) Received: from vc2.local (localhost.localdomain [127.0.0.1]) by vc2.local (Postfix) with ESMTP id 1B0A81D34D2 for <9fans@cse.psu.edu>; Tue, 19 Apr 2005 15:17:34 +0900 (JST) Received: from o.cc.titech.ac.jp (mail-o.cc.titech.ac.jp [131.112.3.2]) by vc2.net.titech.ac.jp (Postfix) with ESMTP id C94CA1D34C3 for <9fans@cse.psu.edu>; Tue, 19 Apr 2005 15:17:33 +0900 (JST) Received: from valinore.titech.ac.jp by mail-o.cc.titech.ac.jp (8.11.3/1.1.10.5/20Feb97-0455PM) id j3J6HVY09626; Tue, 19 Apr 2005 15:17:31 +0900 (JST) Message-ID: To: 9fans@cse.psu.edu From: YAMANASHI Takeshi <9.nashi@gmail.com> Date: Tue, 19 Apr 2005 15:17:29 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at cse.psu.edu Subject: [9fans] watch command X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+nemo=lsub.org@cse.psu.edu Errors-To: 9fans-bounces+nemo=lsub.org@cse.psu.edu 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? -- --upas-fwyeovuxsrsxpdcoopukiybocs--