Implements file channel for incoming triggers. Should be used in read-only mode, hence name - RoFile, tested with ext3 fs on FC6 and with cifs mounted form xp pro. On ext3 if file is not there when zmtrigger.pl starts, it does not bail out but rather patiently waits for file to appear. If file is unlinked on course of action, again patiently waits for file to appear. If file is unlinked and recreated (the same name, different inode), it is closed and reopened. Unlinking and recreating file on xp pro does not really work (you can unlink the file, but can't recreate it until all handles to it are closed). On open eof is found, so any existing data in that file is skipped. If trigger source recreates file for each trigger it sends, change the trigger source not to do that, because you might lose triggers. If you are willing to cope with losing triggers and still want to use this channel, comment out line
Code: Select all
sysseek( *sfh, 0, SEEK_END );
Caution: zmtrigger.pl is updated with this patch to show usage sample! Check before use.
http://www.o6.lv/files/rofile.patch.gz
as usual, no warranties, no nothing, you are on your own. if you want support, hire me