Dear Boost Users,
I've used boost on and off for years for its string parsing. Now I'd
like to use it to replace std::ifstream for file reading. The immediate
requirement is a file > 2^31 bytes. Since my requirement is to replace
ifstream, I was hoping for a fairly simple transition, perhaps even
something I could manage with an emacs global search-and-replace.
I started with kubuntu-feisty's boost 1.33.1. but was unable to execute
the first main in the iostreams tutorial Overview (2.1.1). The
showstopper was the compiler error not defined in scope.
% g++ test.cpp
test.cpp: In functin 'int main()':
test.cpp::9: error: 'file_sink' was not declared in this scope
. . . several more errors.
This is an error without precedent, at least according to google.
Thinking this is a kubuntu-apt-get issue, I downloaded and rebuilt and
installed boost 1_34_1 from scratch. Alas, is still not
declared.
Am I doing something obvious wrong? I'm using g++ 4.1.2.
Does anyone have a few lines of code that will
* open a file?
* seekg() to the beginning, end and arbitrary location in the file?
* tellg() the present file pointer location in the file?
* read(address, number of bytes) from the file?
These are the basic STL features I'm trying to replace.
Many thanks for any pointers to useful documentation (but not to
boost.org/libs/iostreams/doc/index.html, please) or code snippets.
Once I have my "hello world" working, I might start making sense of
templated streams, and why my install can't find
when it is sitting right there in !?!?
--
Peter Leopold
Peter dot Leopold at BioAnalyte dot com http://www.bioanalyte.com