Re: Temp folder question

From: AlanGLLoyd (alanglloyd_at_aol.com)
Date: 11/05/03


Date: 05 Nov 2003 16:46:29 GMT

In article <8nrhqvop5iej9nu383oculfc6lb972lqhn@4ax.com>, Paul <paul@none.com>
writes:

>a) Is this the "correct" way to obtain the windows temp path on all
>versions of Windows, including W2K (NT not needed).:-
>

MSDN says of GetTempPath ...

"Windows 95/98: The GetTempPath function gets the temporary file path as
follows:

The path specified by the TMP environment variable.
The path specified by the TEMP environment variable, if TMP is not defined or
if TMP specifies a directory that does not exist.
The current directory, if both TMP and TEMP are not defined or specify
nonexistent directories.
 
Windows NT/2000: The GetTempPath function does not verify that the directory
specified by the TMP or TEMP environment variables exists. The function gets
the temporary file path as follows:

The path specified by the TMP environment variable.
The path specified by the TEMP environment variable, if TMP is not defined.
The Windows directory, if both TMP and TEMP are not defined. "

It returns the _path_, which includes the final backslash. OTOH if you use
PathAppend it takes care of the backslash between path and filename.

The note above re Win NT/2K is relevant and indicates that one should check
that the directory exists and/or do a ForceDirectory on the path.

Alan Lloyd
alanglloyd@aol.com



Relevant Pages

  • Re: .tmp files
    ... specified by the TMP or TEMP environment variables exists. ... The path specified by the TMP environment variable. ... not defined or if TMP specifies a directory that does not exist. ...
    (microsoft.public.vb.general.discussion)
  • Re: Difference between TEMP and TMP variables?
    ... The path specified by the TEMP environment variable, if TMP is not defined or if TMP specifies a directory that does not exist. ... Windows NT/2000/XP: The GetTempPath function does not verify that the directory specified by the TMP or TEMP environment variables exists. ...
    (microsoft.public.windowsxp.general)
  • Re: Check the temp enviroment variable
    ... I have see my TEMP and TMP location point to C:/TEMP. ... "Susan Ramlet" wrote: ... It's identified by TEMP or TMP in the environment variables ...
    (microsoft.public.office.misc)
  • Re: TEMP vs TMP
    ... >I've heard that two environment variables, TEMP and TMP, should be set ... On an older machine of mine, my autoexec.bat sets TEMP ... >to a subdirectory of a RAM disk, and TMP is not set. ... and it had its origin with Unix (Unix uses TMP ...
    (comp.os.msdos.misc)
  • "Not enough space on temporary disk"
    ... increasing the maxlocksperfile registry setting, ... tmp and temp environment variables to an empty drive with 12Gb free. ... only one thing I can't figure out how to do, and that is change the ASPNET ...
    (microsoft.public.dotnet.framework.aspnet)