basic file io in boost 1_34_1. A compilable 'hello world' example for large (>2^31byte) files?
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
Peter Leopold wrote:
Dear Boost Users,
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.
try changing the offending line to: io::stream_bufferio::file_sink buf("log.txt"); In other words, its a documentation bug... the file_sink is in the boost::iostreams namespace as well.
participants (2)
-
eg
-
Peter Leopold