Spool file library?

J

Thread Starter

Joe Manns

I'm looking for a C++ source code library to implement a file-based FIFO queue. I would like to spool timestamped process data records to a file to be picked up later by another process that would log the records to a remote database, which may or may not reachable.

More specifically, it should work just like a named pipe except:
-it doesn't block when the buffer is full - the pipe just gets longer (or fatter?)
-Data is persistent - i.e. will survive process or platform going down.
-Would have parameters to limit file size, set block sizes, etc.
-Would be nice if records were in human-readable form, but they don't have to be.
-Would be nice if the 'empty' API had a peek option - if the writes fail to the database, then the data should stay in the queue.

Seems a generic tool like this has been done a thousand times, but I haven't figured out the magic words to find it yet.

Thanks,

Joe Manns
 
J

Johan Bengtsson

Ok, this is not the solution but rather some questions...

point 1 and 3 seems to exclude each other. If you want the pipe to grow but there is a limited file size then there is only one option left - discarding the data, is that what you intend?

The records being human readable or not don't seem to have much to do with this however.


Would using a database server be an option? it seems to me to be the easiest way of implementing it?



/Johan Bengtsson

Do you need education in the area of automation?
----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------
 
Top