Changeset 1073 for trunk/dll/sysinfo.c


Ignore:
Timestamp:
Jul 18, 2008, 2:30:20 AM (17 years ago)
Author:
Gregg Young
Message:

Fm2 uses TMP/TEMP directory if set for temporary files and directories. Ticket 20

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/sysinfo.c

    r907 r1073  
    2424#define INCL_LONGLONG
    2525
     26#include "pathutil.h"                   // BldFullPathName
    2627#include "fm3dlg.h"
    2728#include "fm3dll.h"
     
    3435{
    3536  HWND hwnd = (HWND) arg;
    36   CHAR s[2048], *p;
     37  CHAR s[2048], *p, szTempFile[CCHMAXPATH];
    3738  HAB thab;
    3839  HMQ thmq;
     
    4849    if (!WinIsWindow(thab, hwnd))
    4950      goto Abort;
    50     unlinkf("%s", "$RMVIEW.#$#");
    51     fp = xfopen("$RMVIEW.#$#", "w", pszSrcFile, __LINE__);
     51    if (fUseTmp)
     52      BldFullPathName(szTempFile, pTmpDir, "$RMVIEW.#$#");
     53    else
     54      strcpy(szTempFile, "$RMVIEW.#$#");
     55    unlinkf("%s", szTempFile);
     56    fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__);
    5257    if (!fp)
    5358      goto Abort;
     
    6267      runemf2(SEPARATE | INVISIBLE | FULLSCREEN | BACKGROUND | WAIT,
    6368              hwnd, pszSrcFile, __LINE__,
    64               NULL, NULL, "%s", "RMVIEW.EXE");
     69              NULL, NULL, "%s", szTempFile);
    6570      oldstdout = fileno(stdout);
    6671      DosDupHandle(newstdout, &oldstdout);
     
    7075    if (!WinIsWindow(thab, hwnd))
    7176      goto Abort;
    72     fp = xfopen("$RMVIEW.#$#", "r", pszSrcFile, __LINE__);
     77    fp = xfopen(szTempFile, "r", pszSrcFile, __LINE__);
    7378    if (fp) {
    7479      xfgets(s, sizeof(s), fp, pszSrcFile, __LINE__);
     
    98103    WinTerminate(thab);
    99104  }
    100   DosForceDelete("$RMVIEW.#$#");
     105  if (szTempFile)
     106    DosForceDelete(szTempFile);
    101107}
    102108
Note: See TracChangeset for help on using the changeset viewer.