Menu

#66 .csv export: File size >2GB reported as -2147483648 bytes

cdcat-2.3
open
nobody
bug (1)
5
2016-07-01
2016-07-01
Opal
No

Hi,

than you for this useful tool.

With cdcat 2.3.1 on Windows 8.1 64 bit, an export of the catalog as .csv document with contains the file size reports it as -2147483648 bytes (overflow of a signed?).

Entry point in exportcdcatdb.cpp:

int exportCdcatDB::writeFile ( Node *source ) {
double tsize = 0;

//==== CSV ===========
if ( radioCsv->isChecked() ) {
if ( checkExportMediaName->isChecked() ) {
outstring += medianame;
outstring += separator;
}

  if ( checkExportMediaNumber->isChecked() ) {
      outstring += QString().setNum ( medianumber );
      outstring += separator;
  }

  if ( checkExportPath->isChecked() ) {
      outstring += getFilePath ( source );
      outstring += separator;
  }

  if ( checkExportSize->isChecked() ) {
      tsize = ( ( DBFile * ) ( source->data ) ) ->size;
      switch ( ( ( DBFile * ) ( source->data ) ) ->sizeType ) {
          case 0:
              break;
          case 1:
              tsize *= 1024.0;
              break;
          case 2:
              tsize *= 1024.0 * 1024.0;
              break;
          case 3:
              tsize *= 1024.0 * 1024.0 * 1024.0;
              break;
          case 4:
              tsize *= ( 1024.0 * 1024.0 ) * ( 1024.0 * 1024.0 );
              break;
      }
      outstring += QString().setNum ( ( long int ) tsize );
      outstring += separator;
  }

Discussion


Log in to post a comment.