Changeset 1082 for trunk/dll/init.c
- Timestamp:
- Jul 20, 2008, 12:37:36 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/init.c
r1077 r1082 51 51 16 JUL 08 GKY Use TMP directory for temp files 52 52 17 Jul 08 SHL Reduce code bulk in fUseTmp setup 53 19 Jul 08 GKY Use pFM2SaveDirectory, MakeTempName and move temp files to TMP subdirectory if (TMP). 53 54 54 55 ***********************************************************************/ … … 514 515 } 515 516 } 516 517 save_dir(s); 517 if (pTmpDir) 518 strcpy(s, pTmpDir); 519 else 520 save_dir2(s); 518 521 if (s[strlen(s) - 1] != '\\') 519 522 strcat(s, "\\"); 520 523 enddir = &s[strlen(s)]; 521 strcat(s, LISTTEMPROOT);524 strcat(s, "$FM2LI$T"); 522 525 strcat(s, "???"); 523 526 search_handle = HDIR_CREATE; … … 541 544 BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 542 545 DosForceDelete(szTempFile); 546 if (pTmpDir) { 547 wipeallf("%s\\*", pTmpDir); 548 DosDeleteDir(pTmpDir); 549 } 543 550 EndNote(); 544 551 if (FM3ModHandle) … … 650 657 } 651 658 652 / * set up default root names for temp archive goodies */659 // set up default root names for temp file storage and archive goodies 653 660 env = getenv("TMP"); 654 661 if (env == NULL) … … 659 666 if (!rc) { 660 667 if (fs3.attrFile & FILE_DIRECTORY) { 661 // 17 Jul 08 SHL fixme to check writable someday 662 pTmpDir = xstrdup(env, pszSrcFile, __LINE__); 668 CHAR szTempName[CCHMAXPATH]; 669 APIRET ret = 0; 670 // 17 Jul 08 SHL fixme to check writable someday 671 strcpy(szTempName, env); 672 //if (szTempName[strlen(szTempName) - 1] != '\\') 673 // strcat(szTempName, "\\"); 674 MakeTempName(szTempName, NULL, 1); 675 ret = DosCreateDir(szTempName, 0); 676 if (!ret) { 677 pTmpDir = xstrdup(szTempName, pszSrcFile, __LINE__); 678 } 663 679 } 664 680 } … … 666 682 BldFullPathName(ArcTempRoot, pTmpDir, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$"); 667 683 668 /* initialize random number generator */ 684 //Save the FM2 save directory name. This is the location of the ini, dat files etc. 685 { 686 CHAR temp[CCHMAXPATH]; 687 save_dir2(temp); 688 pFM2SaveDirectory = xstrdup(temp, pszSrcFile, __LINE__); 689 } 690 691 // initialize random number generator 669 692 srand(time(NULL) + clock()); 670 693
Note:
See TracChangeset
for help on using the changeset viewer.