Boost.IOStreams mapped_file_sink missing flush() functionality
Hello, I wish to bring to your attention two issues regarding mapped_file_sink from Boost.IOStreams (release 1.62.0): 1. There is no member function `mapped_file_sink::flush()` which I would like to use in my program. I believe it could be implemented portably by using `msync()` for POSIX and `FlushViewOfFile()` for Windows; was the omission of this function a deliberate choice or a minor oversight? 2. The member functions `begin()` and `end()` are implemented for mapped_file_sink but are not documented! This will lead to programmers relying strictly on the docs to use `data()` and `data()+size()` instead. Please update the documentation for the next release 1.63.0.
On 12/5/2016 4:30 PM, AB wrote:
Hello, I wish to bring to your attention two issues regarding mapped_file_sink from Boost.IOStreams (release 1.62.0):
1. There is no member function `mapped_file_sink::flush()` which I would like to use in my program. I believe it could be implemented portably by using `msync()` for POSIX and `FlushViewOfFile()` for Windows; was the omission of this function a deliberate choice or a minor oversight?
Not being the original developer I cannot give you an answer. But if you have code which you feel should work, please create a PR. You could alternately add a Boost trac item for your suggestion.
2. The member functions `begin()` and `end()` are implemented for mapped_file_sink but are not documented! This will lead to programmers relying strictly on the docs to use `data()` and `data()+size()` instead. Please update the documentation for the next release 1.63.0.
I have updated the iostream doc on the 'develop' branch regarding this but will wait for 1.64 release. Thanks for pointing it out.
On 11 Dec 2016 at 12:59, Edward Diener wrote:
Hello, I wish to bring to your attention two issues regarding mapped_file_sink from Boost.IOStreams (release 1.62.0):
1. There is no member function `mapped_file_sink::flush()` which I would like to use in my program. I believe it could be implemented portably by using `msync()` for POSIX and `FlushViewOfFile()` for Windows; was the omission of this function a deliberate choice or a minor oversight?
Not being the original developer I cannot give you an answer. But if you have code which you feel should work, please create a PR. You could alternately add a Boost trac item for your suggestion.
I answered him on his Stackoverflow question asking the same thing at https://stackoverflow.com/questions/40972420/how-to-flush-memory-mappe d-files-using-boosts-mapped-file-sink-class/40999603#40999603. tl;dr; it's deliberately not provided. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
On 12/11/2016 2:42 PM, Niall Douglas wrote:
On 11 Dec 2016 at 12:59, Edward Diener wrote:
Hello, I wish to bring to your attention two issues regarding mapped_file_sink from Boost.IOStreams (release 1.62.0):
1. There is no member function `mapped_file_sink::flush()` which I would like to use in my program. I believe it could be implemented portably by using `msync()` for POSIX and `FlushViewOfFile()` for Windows; was the omission of this function a deliberate choice or a minor oversight?
Not being the original developer I cannot give you an answer. But if you have code which you feel should work, please create a PR. You could alternately add a Boost trac item for your suggestion.
I answered him on his Stackoverflow question asking the same thing at https://stackoverflow.com/questions/40972420/how-to-flush-memory-mappe d-files-using-boosts-mapped-file-sink-class/40999603#40999603.
tl;dr; it's deliberately not provided.
Thanks for the explanation.
participants (3)
-
AB
-
Edward Diener
-
Niall Douglas