fstream on linuxx8664gcc platform

From: LEE, KERRY T. (JSC-SF) (UHCL) <kerry.t.lee1_at_jsc.nasa.gov>
Date: Fri, 13 May 2005 18:29:34 -0500


Dear Root Team,

I have transferred some code from a linuxicc platform ROOT version 4.02/00 to linuxx8664gcc ROOT version 4.04/02 and it crashed due to incorrect determination of the filesize using fstream. Here is a sample code that reproduces the problem, where you just put a file in ascii format in place of "mntExHdd". The correct filesize in my case is 105bytes.

//TestStream.C
{
TString FileName="mntExHdd";

fstream fff(FileName,ios_base::in);
if(fff.good()){
  fff.seekg(0,ios_base::end);

  int FileSize = fff.tellg();
  cout<<"FileSize="<<FileSize<<endl;
  fff.seekg(0,ios_base::beg);
}
fff.close();
}

The results from linuxicc


FreeType Engine v2.1.3 used to render TrueType fonts. Compiled for linuxicc with thread support.  

CINT/ROOT C/C++ Interpreter version 5.15.159, Nov 14 2004 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0] .x TestStream.C
FileSize=105

The Results from linuxx8664gcc


Compiled for linuxx8664gcc with thread support.  

CINT/ROOT C/C++ Interpreter version 5.15.169, Mar 14 2005 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0] .x TestStream.C
FileSize=7470896

Thanks
Kerry Received on Sat May 14 2005 - 01:29:45 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:08 MET