|
From: Igor P. <igo...@po...> - 2003-12-04 10:23:45
|
Hi, Answer to your question depends on how the aplication you mentioned sends alarms to the file. If it sends them to standart output and they are redirected to the file then you can write a program that reads standart input and for each line of input it does what you want to do (something like: <program_that_sends_alarms> | <your_alarm_filter> ). But most probably the situation is as follows: the program writes alarms directly to the file - then your easiest option is to write a program that opens this file for reading and periodically checks if something has changed in that file. If you know unix then command "tail -f" may give you an idea what i am talking about. It is the easiest solution and you can write an ordinary program that does that. As far as I know there is no such thing on windows as fifo special files that you know from unix. But if you want to do it the hard way you can search for infromation on how to write a filesystem filter driver - then you can intercept all the write operations to a file, but that is totally different story. Regards Igor Pierscinski > -----Original Message----- > From: Christian Sch=E4fer [mailto:ca...@kr...] > Sent: Thursday, December 04, 2003 8:42 AM > To: Dev...@li... > Subject: [Dev-C++] pipe to a file? >=20 >=20 > hi Dev-cpp-users, >=20 > I have a difficult problem here and an idea how to solve it, which I > am not really sure of if it would be possible.. >=20 > I have an application running that sends out alarmings. these alarms > are appended to a plain-text-file. one alarm =3D=3D one line. >=20 > I want to write an application that puts itself where the file is, and > recieves the appendings, writes them to another file and several other > things. >=20 > I think this can maybe done by pipes, but I do not know how to do it. > an alarm should be treated like an event, when it occures something > has to be done about it (ring a bell :). >=20 > of course this application would need to run as a service. > I also need some hints or tutorials here, to write a service. > (I usually program for unix systems but that's really different..) >=20 > but first I need to get this append-problem solved. >=20 > thanks in advance! >=20 > =20 > gruss > /Christian mailto:ca...@kr... >=20 > --=20 > I propose that the following character sequence for joke markers: >=20 > :-) > 19-Sep-82 11:44 Scott E Fahlman >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by OSDN's Audience Survey. > Help shape OSDN's sites and tell us what you think. Take this > five minute survey and you could win a $250 Gift Certificate. > http://www.wrgsurveys.com/2003/osdntech03.php?site=3D8 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |