I implemented a small read-only FUSE filesystem in C++ that reads the data from a certain multi-file archive. I used iostreams (actually boost::filesystem::ifstream
) in order to read the files. Now I wonder if that was a wise decision.
First the error messages of iostreams are horrible (see another question by me) and I can't simply return the errno
my file operations caused. But second I wonder if it may be better to use unbuffered IO when implementing a FUSE filesystem (not for reading the archive index but when reading the files - it's an uncompressed archive where files never are split to multiple archive files). Because the application reading the file will buffer if it wants to. Is this buffering just unnecessary overhead?
Also how fast are (boosts) iostreams? Well I can play WAV files from the mounted archive without problems, still I wonder if iostreams just add unnecessary overhead when I don't really need then (the only advantage they provide is that they automatically close the file when they go out of scope).