[boost-users]how to use iostreams::mapped_file

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_bufferio::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 :)
participants (1)
-
Sunil Kumar N