Changeset 2428 in Sophya for trunk/Eval/COS/pbseekios.cc


Ignore:
Timestamp:
Sep 12, 2003, 11:06:16 AM (22 years ago)
Author:
ansari
Message:

Indication probleme avec lecture sous MacOSX 10.2 (g++ 3.1) apres lecture dernier byte du fichier - Reza 12/09/2003

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Eval/COS/pbseekios.cc

    r2322 r2428  
    2424// # while seekg(... ios::beg) works OK (tstseekbegread())
    2525// csh> ./pbseekios
     26// September 2003
     27// The problem with seekg(... ios::end) seems to be solved
     28// with gcc 3.1,
     29// However, on MacOSX 10.2, with gcc 3.1, reading the last byte of
     30// a file causes an error and stream can not be positionned anymore
    2631// ----------------------------------------------------
    2732
     
    4853  float fv;
    4954  char * flnm = "pbseekios.dat";
    50 // ofstream os(flnm, ios::out | ios::binary); 
     55 ofstream os(flnm, ios::out | ios::binary); 
    5156  cout << ">>>> tstseqwrite() - Sequential writing to file " << flnm << endl;
    52   ofstream os(flnm, ios::out ); 
     57  //  ofstream os(flnm, ios::out ); 
    5358  for(i=0; i<7; i++) {
    5459    iv = 1000+i*10;
     
    8186    cout << "Read@" << i << " : Pos= " << pos << " IV=" << iv
    8287         << " FV= " << fv << " Expect:("
    83          << iv0 << "," << fv0 << ")" << endl;
     88         << iv0 << "," << fv0 << ")"
     89         << " ->NewPos="<< is.tellg() << endl;
    8490    if (iv != iv0) rc++;
    8591  }
     
    115121    cout << "Read@" << num[i] << " : Pos= " << pos << " IV=" << iv
    116122         << " FV= " << fv << " Expect:("
    117          << iv0 << "," << fv0 << ")" << endl;
     123         << iv0 << "," << fv0 << ")"
     124         << " ->NewPos="<< is.tellg() << endl;
    118125    if (iv != iv0) rc++;
    119126  }
     
    149156    cout << "Read@" << num[i] << " : Pos= " << pos << " IV=" << iv
    150157         << " FV= " << fv << " Expect:("
    151          << iv0 << "," << fv0 << ")" << endl;
     158         << iv0 << "," << fv0 << ")"
     159         << " ->NewPos="<< is.tellg() << endl;
    152160    if (iv != iv0) rc++;
    153161  }
Note: See TracChangeset for help on using the changeset viewer.