9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] How to do a generic filter for files?
@ 2001-01-10 16:20 Jean Mehat
  0 siblings, 0 replies; 4+ messages in thread
From: Jean Mehat @ 2001-01-10 16:20 UTC (permalink / raw)
  To: 9fans

I would like to do a program, that I would interpose between
a Plan 9 file and processes accessing this file. My first idea was
to have a program post a pipe in /srv and mount this pipe end
in place of the interesting file (say /dev/draw/1/data, for example).
Then when anything is written by a program in /dev/draw/1/data,
the program receives the data on the other end of the pipe, writes
it into the real file and dumps it into a file for further examination,
for example.

The problem is with files that can be read, like /net/arp; the program
should open and read this file only when a process is trying to read
the file; so the question is: is there a simple way for the program to
know that a process opened the pipe and is trying to read its contents?
Or, is there no simpler way than to build a user level file server to do
that?

--
Jean Mehat, universite de Paris 8 Vincennes a Saint Denis,
jm@ai.univ-paris8.fr, (33) 1 4940 6403, (33) 1 4940 6783 (fax)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] How to do a generic filter for files?
@ 2001-01-10 18:15 rog
  2001-01-10 17:17 ` Boyd Roberts
  0 siblings, 1 reply; 4+ messages in thread
From: rog @ 2001-01-10 18:15 UTC (permalink / raw)
  To: 9fans

i wrote:
> somewhat more trivial than it used to be.

that is, somewhat more trivial than a not-very-trivial thing... :-)
ahem.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] How to do a generic filter for files?
@ 2001-01-10 17:35 rog
  0 siblings, 0 replies; 4+ messages in thread
From: rog @ 2001-01-10 17:35 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

a pipe is kept open by virtue of being placed in /srv. there are no
indications of further opens.

pipefile(1) takes this approach as far as is reasonable, i think.

if you want to know when a file is opened, you will indeed need to
write a user-level fileserver.  the 9p(2) library makes that somewhat
more trivial than it used to be.

  cheers,
    rog.


[-- Attachment #2: Type: message/rfc822, Size: 2505 bytes --]

To: cse.psu.edu!9fans
Subject: [9fans] How to do a generic filter for files?
Date: Wed, 10 Jan 2001 17:20:26 +0100 (MET)
Message-ID: <200101101620.RAA08051@colombie.ai.univ-paris8.fr>

I would like to do a program, that I would interpose between
a Plan 9 file and processes accessing this file. My first idea was
to have a program post a pipe in /srv and mount this pipe end
in place of the interesting file (say /dev/draw/1/data, for example).
Then when anything is written by a program in /dev/draw/1/data,
the program receives the data on the other end of the pipe, writes
it into the real file and dumps it into a file for further examination,
for example.

The problem is with files that can be read, like /net/arp; the program
should open and read this file only when a process is trying to read
the file; so the question is: is there a simple way for the program to
know that a process opened the pipe and is trying to read its contents?
Or, is there no simpler way than to build a user level file server to do
that?

--
Jean Mehat, universite de Paris 8 Vincennes a Saint Denis,
jm@ai.univ-paris8.fr, (33) 1 4940 6403, (33) 1 4940 6783 (fax)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] How to do a generic filter for files?
  2001-01-10 18:15 rog
@ 2001-01-10 17:17 ` Boyd Roberts
  0 siblings, 0 replies; 4+ messages in thread
From: Boyd Roberts @ 2001-01-10 17:17 UTC (permalink / raw)
  To: 9fans

> that is, somewhat more trivial than a not-very-trivial thing... :-)

so you're saying it's slightly more trivial than a trivial
thing that you've never seen?  :-)




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-01-10 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-10 16:20 [9fans] How to do a generic filter for files? Jean Mehat
2001-01-10 17:35 rog
2001-01-10 18:15 rog
2001-01-10 17:17 ` Boyd Roberts

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).