Changeset 15927


Ignore:
Timestamp:
2008-06-09T14:34:46+12:00 (14 years ago)
Author:
anna
Message:

The old method for checking free disk space overflows (returns a negative number) when the physical free disk space is bigger than 4G. So instead of comparing by byte, now we compare by K. The return type is also changed, from unsigned long to double.

Location:
other-projects/trunk/gsinstaller
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • other-projects/trunk/gsinstaller/DiskSpace.cpp

    r11664 r15927  
    5454}
    5555
    56 unsigned long DiskSpace::totalFreeSpace()
    57 { return this->freeClusters * this->sectorsPerCluster * this->bytesPerSector;
     56unsigned double DiskSpace::totalFreeSpace()
     57{   return this->freeClusters * (((double) (this->sectorsPerCluster * this->bytesPerSector)) / (double) (1024));
    5858}
    5959
  • other-projects/trunk/gsinstaller/DiskSpace.h

    r11664 r15927  
    1515  int                   fileClusters(int fileSize);
    1616  BOOL                  initialisedOk();
    17   unsigned long totalFreeSpace();
     17  unsigned double totalFreeSpace();
    1818};
    1919
  • other-projects/trunk/gsinstaller/README.txt

    r11685 r15927  
    16161. C:\MSDEV\bin\VCVARS32.bat
    17172. nmake /f win32.mak (in the gsinstaller directory)
     18
     19Note: stlport.zip is required for compiling. This file is avaible in Greenstone SVN at http://svn.greenstone.org/gsdl/trunk/packages/windows/stlport/. Download and unzip the zip file, and change the include path in win32.mak accordingly.
  • other-projects/trunk/gsinstaller/fileCopier.cpp

    r11664 r15927  
    216216}
    217217
    218 unsigned long fileCopySet::getCopiedSize(DiskSpace &space)
     218unsigned double fileCopySet::getCopiedSize(DiskSpace &space)
    219219{
    220220  // initialise counters for size
     
    229229      here ++;
    230230    }
    231   return copiedSize;
     231  return (double) copiedSize / (double) 1024;
    232232}
    233233
     
    303303      if (space.totalFreeSpace() < copiedSize)
    304304    {
     305      char buffer[100];
     306      sprintf(buffer, "Total free space on disk %3.1fMb, but the size of the copied collection is %3.1fMb", (double) space.totalFreeSpace() / (double) (1024), (double) copiedSize / (double) (1024));       
     307      MessageBox(0, buffer, "Greenstone Installer", MB_OK);
     308
    305309      return false;
    306310    }
  • other-projects/trunk/gsinstaller/fileCopier.h

    r11664 r15927  
    2929  unsigned long getOriginalSize();
    3030  unsigned long getOriginalFiles();
    31   unsigned long getCopiedSize(DiskSpace &space);
     31  unsigned double getCopiedSize(DiskSpace &space);
    3232  bool ensureParent(FilePath &child, fileCopyMonitor *monitor);
    3333  bool copyFile(File *file, fileCopyMonitor *monitor, copyProgressBar *progressBar);
Note: See TracChangeset for help on using the changeset viewer.