Boost logo

Boost :

Subject: [boost] boost mapped_file issue
From: dophine (dophinehk_at_[hidden])
Date: 2011-11-01 21:39:18


Hi all,

I try to use memory map file. However, I don't know why the readsome return
0. It is fine if I use getline.

int main(int argc,char *argv[])
{
        boost::iostreams::mapped_file_source source(argv[1]);
        boost::iostreams::stream<boost::iostreams::mapped_file_source>
input(source);

        while(!input.eof())
        {
                char b[1];
                streamsize iRet = input.readsome(b, 1);
                cout << iRet << endl;
                cout << b[iRet];
        }
        //std::string line;
        //while(std::getline(input, line)) {
        // std::cout << "Line: " << line << std::endl;
        //}
        return 1;
}

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-mapped-file-issue-tp3971495p3971495.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk