[Mono-list] UnixStream/Pipe Best Practices

Michael Schurter michael at susens-schurter.com
Tue Nov 14 11:21:20 EST 2006


On Tue, 2006-11-14 at 10:18 -0500, Gonzalo Paniagua Javier wrote:
> I did something similar and there's no need for UnixStream or anything
> like that. Just:
> 
> 	destination df_firewall { pipe("/dev/firewall-fifo"); };
> 
> And then open /dev/firewall-fifo as you would open any other file:
> 
> using (StreamReader reader = new StreamReader (File.OpenRead (args [0]),
> Encoding.ASCII)) {
> 	string line;
> 	while ((line = reader.ReadLine ()) != null) {
> 		if (line.IndexOf ("sshd") != -1)
> 		ProcessLine (line);
> 	}
> }

Worked perfectly!  Thanks!

Michael Schurter



More information about the Mono-list mailing list