SFIO: Safe/Fast String/File IO

This paper describes Sfio, a new input/output library, that can be used as a replacement for Stdio, the C language standard I/O library. Sfio is more complete, consistent, and efficient than Stdio. New facilities are provided for convenient, safe and efficient manipulation of data streams. An Sfio stream may be entirely memory resident or it may correspond to some actual file. Alternative I/O disciplines can be applied to a stream to customize its behavior with respect to data transformation and exception handling. Stream pools can be maintained to guarantee stream synchronization when switching streams for I/O operations. Separate streams can be stacked on one another to make new virtual streams. Both source and binary compatibility packages are provided allowing Stdio-based programs to benefit from the new library without recoding. Sfio has been used successfully in a number of applications including many rewritten standard system utilities. Benchmark timings show that Sfio performs very well against Stdio and standard utilities can gain substantial performance improvement when based completely on Sfio.

[1]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[2]  Andrew Hume A tale of two greps , 1988, Softw. Pract. Exp..