hi, all
    The platform: windows xp, vc 71 

        I want download file with .net plugin,and write to the disk before 
osgDB::readfile.
So I add some code :

            if( reader != 0L )
                        {
//*******************************************************************************************
//add following code...
                                std::string cacheFile = localCacheDir + '/' + 
fileName;
                                osgDB::makeDirectoryForFile( cacheFile );
                                std::ofstream fout(cacheFile.c_str());

                                std::ios::pos_type pos = sio->tellg();
                                char c;
                                while(!sio->eof())
                                {
                                        c = sio->peek();
                                        fout.put(c);
                                }
                                fout.flush();
                                fout.close();
                                sio->seekg(pos);
//*******************************************************************************************

                readResult = readFile(objectType, reader, *sio, local_opt.get() 
);
                        }

but I find that the result is wrong. it is seen that some unwanted '0D' was 
writen into the file.
why?

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to