Changeset 36 for trunk/dll/worker.c


Ignore:
Timestamp:
Oct 17, 2002, 3:53:23 AM (23 years ago)
Author:
root
Message:

Handle large partitions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/worker.c

    r2 r36  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Worker thread
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2001, 2002 Steven H.Levine
     10
     11  Revisions     16 Oct 02 SHL - Comments
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_WIN
     
    689703                    existed = (IsFile(newname) != -1);
    690704                    isnewer = IsNewer(wk->li->list[x],newname);
    691 /*
    692 {
    693 static char temp[CCHMAXPATH * 3];
    694 
    695 sprintf(temp,"Target: %s\rSource: %s\rOverold: %lu\rOvernew: %lu\rIsNewer: %lu\rExisted: %lu",newname,wk->li->list[x],overold,overnew,isnewer,existed);
    696 saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,temp);
    697 }
    698 */
     705                    /*
     706                    {
     707                      char temp[CCHMAXPATH * 3];
     708                      sprintf(temp,"Target: %s\rSource: %s\rOverold: %lu\rOvernew: %lu\rIsNewer: %lu\rExisted: %lu",newname,wk->li->list[x],overold,overnew,isnewer,existed);
     709                      saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,temp);
     710                    }
     711                    */
    699712                    if(existed &&
    700713                       wk->li->type != IDM_RENAME &&
     
    810823
    811824                        FSALLOCATE  fsa;
    812                         ULONG       totalsize;
     825                        ULONG       clFreeBytes;
    813826                        CHAR       *ptr;
    814827                        INT         cntr;
     
    820833                                           &fsa,
    821834                                           sizeof(FSALLOCATE))) {
    822                           totalsize = fsa.cUnitAvail * fsa.cSectorUnit *
     835                          // Assume <2GB since file did not fit
     836                          clFreeBytes = fsa.cUnitAvail * fsa.cSectorUnit *
    823837                                      fsa.cbSector;
    824                           if(totalsize) {
     838                          if(clFreeBytes) {
     839                            // Find item that will fit in available space
    825840                            for(cntr = x + 1;wk->li->list[cntr];cntr++) {
    826841                              DosError(FERR_DISABLEHARDERR);
     
    830845                                                   sizeof(fs4)) &&
    831846                                 !(fs4.attrFile & FILE_DIRECTORY) &&
    832                                  fs4.cbFile + fs4.cbList <= totalsize) {
     847                                 fs4.cbFile + fs4.cbList <= clFreeBytes) {
     848                                // Swap with failing item
    833849                                ptr = wk->li->list[x];
    834850                                wk->li->list[x] = wk->li->list[cntr];
Note: See TracChangeset for help on using the changeset viewer.