Changeset 1120


Ignore:
Timestamp:
Aug 26, 2008, 3:08:28 AM (17 years ago)
Author:
Gregg Young
Message:

Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if less than 10 KiB (It hangs and can't be closed) (Ticket 214) Also some cleanup of the error messages for CheckDriveSpaceAvail.

Location:
trunk/dll
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1117 r1120  
    5757  16 Jul 08 GKY Use TMP directory for temp files if present. Use MakeTempName
    5858  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory
     59  25 Aug 08 GKY Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if
     60                less than 10 KiB (It hangs and can't be closed)
    5961
    6062***********************************************************************/
     
    444446    info = find_type(arcname, NULL);
    445447  arctemp = xmallocz(CCHMAXPATH, pszSrcFile, __LINE__);
     448  if (CheckDriveSpaceAvail(ArcTempRoot, ullDATFileSpaceNeeded, ullTmpSpaceNeeded) == 1)
     449    saymsg(MB_OK,
     450           HWND_DESKTOP,
     451           NullStr,
     452           GetPString(IDS_ARCTMPDRIVESPACELIMITED),
     453           ArcTempRoot);
    446454  MakeTempName(arctemp, ArcTempRoot, 2);
     455
    447456
    448457ReTry:
     
    21352144                         CM_SEARCHSTRING,
    21362145                         MPFROMP(&srch), MPFROMLONG(CMA_FIRST));
    2137         if (pci && (INT) pci != -1) {
    2138 
    2139           USHORT attrib = CRA_CURSORED;
     2146        if (pci && (INT) pci != -1) {
     2147
     2148          USHORT attrib = CRA_CURSORED;
     2149
    21402150
    21412151          /* make found item current item */
     
    22812291                           CM_QUERYRECORDEMPHASIS,
    22822292                           MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
    2283           if (pci && (INT) pci != -1) {
     2293          if (pci && (INT) pci != -1) {
    22842294            if (fSplitStatus && hwndStatus2) {
    22852295              if (dcd->ullTotalBytes)
     
    26352645        OpenDirCnr((HWND) 0, hwndMain, dcd->hwndFrame, FALSE, (char *)mp1);
    26362646      }
    2637       else if (mp1 && IsFile(mp1) == 1) {
     2647      else if (mp1 && IsFile(mp1) == 1 &&
     2648               CheckDriveSpaceAvail(ArcTempRoot, ullDATFileSpaceNeeded, ullTmpSpaceNeeded) != 2) {
    26382649        StartArcCnr(HWND_DESKTOP,
    26392650                    dcd->hwndFrame, (CHAR *) mp1, 4, (ARC_TYPE *) mp2);
     
    33653376    ArcMenu = ArcCnrMenu = (HWND) 0;
    33663377    EmptyArcCnr(hwnd);
     3378#     ifdef FORTIFY
     3379    Fortify_LeaveScope();
     3380#     endif
    33673381    break;
    33683382  }
  • trunk/dll/collect.c

    r1084 r1120  
    5454  20 Jul 08 GKY Add save/append filename to clipboard.
    5555                Change menu wording to make these easier to find
     56  25 Aug 08 GKY Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if
     57                less than 10 KiB (It hangs and can't be closed)
    5658
    5759***********************************************************************/
     
    14431445      if (mp1 && !IsFile((CHAR *)mp1))
    14441446        OpenDirCnr(HWND_DESKTOP, hwndMain, dcd->hwndFrame, FALSE, (PSZ) mp1);
    1445       else if (mp1 && IsFile(mp1) == 1)
     1447      else if (mp1 && IsFile(mp1) == 1 &&
     1448               CheckDriveSpaceAvail(ArcTempRoot, ullDATFileSpaceNeeded, ullTmpSpaceNeeded) != 2)
    14461449        StartArcCnr(HWND_DESKTOP,
    14471450                    dcd->hwndFrame, (CHAR *)mp1, 4, (ARC_TYPE *) mp2);
  • trunk/dll/defview.c

    r985 r1120  
    1818  20 Dec 07 GKY Open jpg files with OS2 object default since image.exe fails
    1919  29 Feb 08 GKY Refactor global command line variables to notebook.h
     20  25 Aug 08 GKY Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if
     21                less than 10 KiB (It hangs and can't be closed)
    2022
    2123***********************************************************************/
     
    304306  }
    305307
    306   if (ExecAssociation(hwnd, filename) == -1) {
     308  if (ExecAssociation(hwnd, filename) == -1 &&
     309      CheckDriveSpaceAvail(ArcTempRoot, ullDATFileSpaceNeeded, ullTmpSpaceNeeded) != 2) {
    307310    hwndArc = StartArcCnr((fExternalArcboxes || !swp ||
    308311                           strcmp(realappname, FM3Str)) ?
  • trunk/dll/dircnrs.c

    r1113 r1120  
    4848  02 Aug 08 GKY Always pass temp variable point to treecnr UM_SHOWME to avoid
    4949                freeing dcd->directory early
     50  25 Aug 08 GKY Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if
     51                less than 10 KiB (It hangs and can't be closed)
    5052
    5153***********************************************************************/
     
    16041606        OpenDirCnr(hwnd, dcd->hwndParent, dcd->hwndFrame, FALSE, (char *)mp1);
    16051607      }
    1606       else if (mp1 && IsFile(mp1) == 1) {
     1608      else if (mp1 && IsFile(mp1) == 1 &&
     1609               CheckDriveSpaceAvail(ArcTempRoot, ullDATFileSpaceNeeded, ullTmpSpaceNeeded) != 2) {
    16071610        StartArcCnr(HWND_DESKTOP,
    16081611                    dcd->hwndFrame, (CHAR *)mp1, 4, (ARC_TYPE *) mp2);
  • trunk/dll/fm3dll.str

    r1112 r1120  
    8686Dri~ves...
    8787The target path %s will have less then %s bytes of space remaining following this operation. Do you wish to continue?
    88 The TMP directory %s has less then %s of space. Do you wish to use the FM/2 save directory for temporary files? In any case you should free some space on this drive
    89 The TMP directory %s has less then %s of space & The FM/2 save directory %s has less then %s of space. You should free some space on these drives
    90 The FM2 save directory %s has less then %s of space. You should free some space on this drive
    91 The target path %s will have less then %s bytes of space remaining following this operation. You should free some space on this drive immediately
     88The TMP directory %s has limited space remaining. Do you wish to use the FM/2 save directory for temporary files? In any case you should free some space on this drive
     89The TMP directory %s & the FM/2 save directory %s both have limited space remaining. You should free some space on these drives
     90The FM2 save directory %s has limited space remaining. You should free some space on this drive
     91FM/2's TMP and/or save directory has limited space remaining. You should free some space on this drive immediately
    9292The target path %s has inadequate space remaining for the operation requested. Free some space and try again.
    93 
     93The TMP directory %s has limited space remaining. This will limit your ability to view large files. You should free some space on this drive
    9494/OPEN
    9595/CLOSE
  • trunk/dll/fm3str.h

    r1112 r1120  
    2020  28 Jun 08 JBS Add string for warning message for changing/deleting FN2SHUTDOWN state
    2121  17 Jul 08 JBS "Renumbered" IDS_SHUTDOWNSTATE because its old numbers was "in use"
     22  24 Aug 08 GKY Add strings for limited/inadequate drive space checks
    2223
    2324***********************************************************************/
     
    122123#define IDS_DRIVESPACELIMITEDTMPSAVE                          90
    123124#define IDS_DRIVESPACEEXCEEDED                                91
     125#define IDS_ARCTMPDRIVESPACELIMITED                           92
    124126#define IDS_OPENCMDTEXT                                       93
    125127#define IDS_CLOSECMDTEXT                                      94
  • trunk/dll/init.c

    r1117 r1120  
    714714        if (!ret) {   //check writable
    715715          pTmpDir = xstrdup(szTempName, pszSrcFile, __LINE__);
    716         } //fixme to check freespace > 5 MB
     716        }
    717717      }
    718718    }
     
    725725    pFM2SaveDirectory = xstrdup(temp, pszSrcFile, __LINE__);
    726726  }
     727  // Check free space on TMP and FM2 Save drives
    727728  {
    728     CHAR szKBTmp[20];
    729 
    730729    ullTmpSpaceNeeded = 5120000;
    731     CommaFmtULL(szKBTmp, sizeof(szKBTmp),
    732                 ullTmpSpaceNeeded, 'M');
    733     printf("%s\r", szKBTmp); fflush(stdout);
    734730    if (pTmpDir && CheckDriveSpaceAvail(pTmpDir, ullTmpSpaceNeeded, 0) == 1) {
    735731      if (CheckDriveSpaceAvail(pFM2SaveDirectory, ullTmpSpaceNeeded, 0) == 0){
     
    738734                     NullStr,
    739735                     GetPString(IDS_TMPDRIVESPACELIMITED),
    740                      pTmpDir,
    741                      szKBTmp);
     736                     pTmpDir);
    742737        if (ret == MBID_YES)
    743738          pTmpDir = pFM2SaveDirectory;
     
    749744               GetPString(IDS_SAVETMPDRIVESPACELIMITED),
    750745               pTmpDir,
    751                szKBTmp,
    752                pFM2SaveDirectory,
    753                szKBTmp);
     746               pFM2SaveDirectory);
    754747    }
    755748    else if (CheckDriveSpaceAvail(pFM2SaveDirectory, ullTmpSpaceNeeded, 0) == 1)
     
    758751             NullStr,
    759752             GetPString(IDS_SAVEDRIVESPACELIMITED),
    760              pFM2SaveDirectory,
    761              szKBTmp);
     753             pFM2SaveDirectory);
    762754  }
    763755  BldFullPathName(ArcTempRoot, pTmpDir, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$");
  • trunk/dll/misc.c

    r1118 r1120  
    22372237    CHAR szKB[20];
    22382238
    2239     if (ullFreeSpaceWhenComplete == 0)
    2240       ullSpaceNeeded = 0;
    2241     commafmt(szKB, sizeof(szKB),
    2242              (ULONG) ullFreeQty - ullSpaceNeeded);
     2239    CommaFmtULL(szKB, sizeof(szKB),
     2240                ullFreeQty - ullSpaceNeeded, ' ');
    22432241    if (ullFreeSpaceWhenComplete == 0) {
    22442242      saymsg(MB_OK,
     
    22462244             NullStr,
    22472245             GetPString(IDS_DRIVESPACELIMITEDTMPSAVE),
    2248              pTargetPath,
    2249              szKB);
     2246             pTargetPath);
    22502247      return 0;
    22512248    }
Note: See TracChangeset for help on using the changeset viewer.