Boost logo

Boost Users :

Subject: Re: [Boost-users] [iostreams] Some basic questions about filtering_stream
From: Stephen Greenfield (StephenG_at_[hidden])
Date: 2013-07-25 15:51:07


Jens,


>to 1: Make your functions take a std::ostream& reference, that way you
>are not bound to the streamtype.
>
>to 2: A streambuf is not a stream, its a buffer for a stream, please
>consult the documentation for usage :)

Many thanks -- I see that now. However, there is a mysterious piece of
this puzzle that still eludes me: Since the filtering_streambuf
(myCompressedFileStream) needs the ofstream file (myFileStream) defined
FIRST, in order to push it, how do I then construct a valid ostream that I
can stream to and will be compressed INTO the file I specified in the
ofstream. If I just output to myFileStream, it doesn't go through the
filtering_streambuf and UNCOMPRESSED text ends up in the file.


>to 3: if you do not specify a concrete path, afaik the file should be
>created in the directory where the file is run from.

I found the location where the file was being created:
<user>/Library/Preferences/<app's preferences folder>. Because the path
wasn't specified in the test case of "hello.z", it might be because that
was the last folder/directory navigated to by the app's code. I didn't
originally find it because normally Spotlight doesn't search those
folders. However, Activity Monitor revealed hello.z as an open file --
complete with path!

Stephen


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net