Boost logo

Boost Users :

From: Sunil Kumar N (freakytech_at_[hidden])
Date: 2006-05-17 21:15:24


Could someone point me to a link for a sample program of using
iostreams::mapped_file(except the default tutorial)...I gave a shot at it
and snippet is as follows...

    io::mapped_file_params aparams("c:\\mf.txt");
    aparams.new_file_size = 1e8;
    aparams.mode = BOOST_IOS::out;
    io::stream_buffer<io::mapped_file> mfStrmBuf(aparams);
    ostream out(&mfStrmBuf);
   out << .... keep on writing to file...

it works but I need to know how one create a mapped_file that has to grow
beyond new_file_size!! That means I dont know the size of the file to be
created at compile time!!

How to flush explicitly?

I am in the process of understanding as to which one offers better
performance with respect to time taken when some thousands of lines have to
be written to a file.....ofstream vs mapped_file?

Thanks in advance :)



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