[Iostreams] Issue with mapped_file
Hello,
There is something I don't get with mapped_file from the IOStreams
library. Here is an example:
// Code snippet
#include <iostream>
#include
JD wrote:
I tried without the new_file_size, I tried with a mapped_file... Is there something I don't get? Why are we not able to open a file that already exist?
Oops... I mistakenly sent a reply to devel instead of boost-users... here it is again. I assume you have mapped_file.cpp in your project already (otherwise I don't think you could link). Upon quick inspection, your example seems to mimic some of the test code almost identically (i.e. in mapped_file_test.cpp), so I think it should work... What happens when you try to run the unit tests in the boost_1_34_1\libs\iostreams\test subdirectory of the source tarball? Do they pass?
eg wrote:
JD wrote:
I tried without the new_file_size, I tried with a mapped_file... Is there something I don't get? Why are we not able to open a file that already exist?
I assume you have mapped_file.cpp in your project already (otherwise I don't think you could link).
Well no, I'm under windows (XP) compiling with msvc-8.0 so there is automatic linking activated. I do not compile mapped_file.cpp with my source code.
Upon quick inspection, your example seems to mimic some of the test code almost identically (i.e. in mapped_file_test.cpp), so I think it should work...
What happens when you try to run the unit tests in the boost_1_34_1\libs\iostreams\test subdirectory of the source tarball?
Do they pass?
Yes, they do. (?) All tests are passed... And yes, the code mimic the example as I iteratively converge my code to it because I was not understanding what I was doing wrong. I don't get it. JD
I assume you have mapped_file.cpp in your project already (otherwise I don't think you could link).
Well no, I'm under windows (XP) compiling with msvc-8.0 so there is automatic linking activated. I do not compile mapped_file.cpp with my source code.
Upon quick inspection, your example seems to mimic some of the test code almost identically (i.e. in mapped_file_test.cpp), so I think it should work...
What happens when you try to run the unit tests in the boost_1_34_1\libs\iostreams\test subdirectory of the source tarball?
Do they pass?
Yes, they do. (?) All tests are passed... And yes, the code mimic the example as I iteratively converge my code to it because I was not understanding what I was doing wrong.
I don't get it.
Nobody? I have played around with the example, and when I force the filename used to open the mapped_file to something like "toto", the example fails! Like if the example would only work on the particular filename used in it. But the filename of the example does not work in my code. I really don't understand what's going on here, can someone help? Subsidiary question: Who is maintaining this library? Thanks for your help. JD
JD wrote:
Nobody? I have played around with the example, and when I force the filename used to open the mapped_file to something like "toto", the example fails! Like if the example would only work on the particular filename used in it. But the filename of the example does not work in my code. I really don't understand what's going on here, can someone help?
Ok... I debugged into the library and found that you have stumbled upon a bug in the code. A prior call is setting the last error which some subsequent logic depends on. At line 198 in mapped_file.cpp. This triggered a recollection... so I searched in the bug database at http://svn.boost.org/trac It turns out this was previously reported as Ticket # 699 where it suggests a solution and some related issues. See: http://svn.boost.org/trac/boost/ticket/699
Subsidiary question: Who is maintaining this library?
No idea.
At 7:42 AM +0200 10/2/07, JD wrote:
Subsidiary question: Who is maintaining this library?
Jonathan Turkanis is the maintainer of the iostreams library. -- -- Marshall Marshall Clow Idio Software mailto:marshall@idio.com It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning. It is by caffeine alone I set my mind in motion.
Marshall Clow wrote:
At 7:42 AM +0200 10/2/07, JD wrote:
Subsidiary question: Who is maintaining this library?
Jonathan Turkanis is the maintainer of the iostreams library.
Is Jonathan available at all? I thought someone else picked up this library in his absence, but I can't remember who. Jeff Flinn
Jeff Flinn wrote:
Marshall Clow wrote:
At 7:42 AM +0200 10/2/07, JD wrote:
Subsidiary question: Who is maintaining this library? Jonathan Turkanis is the maintainer of the iostreams library.
Is Jonathan available at all? I thought someone else picked up this library in his absence, but I can't remember who.
Jeff Flinn
The patch seems to work, can someone integrate it? JD
Jeff Flinn wrote:
Marshall Clow wrote:
At 7:42 AM +0200 10/2/07, JD wrote:
Subsidiary question: Who is maintaining this library? Jonathan Turkanis is the maintainer of the iostreams library.
Is Jonathan available at all? I thought someone else picked up this library in his absence, but I can't remember who.
Jeff Flinn
The patch seems to work, can someone integrate it? JD
JD wrote:
Jeff Flinn wrote:
At 7:42 AM +0200 10/2/07, JD wrote:
Subsidiary question: Who is maintaining this library? Jonathan Turkanis is the maintainer of the iostreams library. Is Jonathan available at all? I thought someone else picked up this
Marshall Clow wrote: library in his absence, but I can't remember who.
Jeff Flinn
The patch seems to work, can someone integrate it?
See ticket # 856: http://svn.boost.org/trac/boost/ticket/856 It seems to be a duplicate of #699 In # 856 there is a patch applied to a sandbox branch with a comment that it needs approval of the maintainer. The changset is here: http://svn.boost.org/trac/boost/changeset/38879
participants (4)
-
eg
-
JD
-
Jeff Flinn
-
Marshall Clow