[clean-list] funlib new file IO

Marco Kesseler m.kesseler at xs4all.nl
Thu Nov 3 23:41:20 MET 2005


Dear all,

I would like to inform you that "funlib" 
(https://sourceforge.net/projects/funlib/) has implemented its own file 
system (windows only). You might find it useful, if only to implement 
similar things yourself. See below for the things it can do and StdEnv 
not (yet?):

* File operations are overloaded on two argument types: file and data. 
As a result, it is possible to have number of distinct file types with 
different implementations (and create your own).

* Open the very same file for both shared reading and unique appending. 
Shared reading can only be done on the existing contents, writing only 
after the existing contents. This ensures referential transparency. For 
funlib this feature was necessary to be able to update PDF files, 
without having to resort to unique file access for the reading part as well.

* Create a (fixed size) unique string whose contents (i.e. excluding its 
headers) are placed in a memory-mapped file. This makes it possible to 
write into a file by updating the string. For large strings this also 
reduces garbage collection times, as the string gets stored outside the 
heap (as long as it remains unique, and gets updated in place...). Using 
this for the output bitmap has seriously increased performance for the 
JPEG decoder.

* Use read-only memory-mapped file. This can be faster than ordinary 
file access in certain situations (at the cost of taking up extra 
virtual memory).

For the moment, this is accessible via the sourceforge public CVS only. 
I still have to find the time to consider other platforms, document some 
things, and  make a file release. The funlib file system should not be 
used together with StdFile (the compiler will complain if you import 
both modules, but one should not entirely rely on that)

regards,
Marco



More information about the clean-list mailing list