trap on input to a file

2007-12-25 10:52:00

Thanks to:

Thomas Knox

Craig McLean

Sanjiv K. Bhatia

Denise Naomi Ishikawa

Bruce R. Zimmer

Ravi Channavajhala

for their answers. Ideas included using fstat() in C to continually

check the file, sending output to stderr (no can do - it's built

into the binary and I'd still need to set a constant watch),

modifying the program that's generating the message (no can do -

don't have access to them). But the winners, for us scripting guys,

are:

swatch, which is freely available and already set up to do this

stuff, and changing the output file to a named pipe (mknod <file> p).

Using the named pipe is the method I've gone for, mostly because I

received that response first (it also saves me time learning how to

configure swatch - another bonus). I can now read from that pipe and

act on the input as it is received.

Cheers,

Stuart Whitby.

S

U BEFORE POSTING please READ the FAQ located at

N ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq

. and the list POLICY statement located at

M ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/policy

A To submit questions/summaries to this list send your email message to:

N sun-managers@ececs.uc.edu

A To unsubscribe from this list please send an email message to:

G majordomo@codeprof.ececs.uc.edu

E and in the BODY type:

R unsubscribe sun-managers

S Or

. unsubscribe sun-managers original@subscription.address

L To view an archive of this list please visit:

I http://www.latech.edu/sunman.html

S

T

Comments

Got something to say?

You must be logged in to post a comment.