Temp folder

  • Thread starter Thread starter Richard Otter
  • Start date Start date
R

Richard Otter

I'm using the call
DWORD GetTempPath(
DWORD nBufferLength,
LPTSTR lpBuffer
);
to get the temp folder on Win2K and XP. The call returns the folder name
using the 8.3 names, yet the value is stored in the System Properties ENV
variables as long file name format.I really don't want to show users a 8.3
file name. I can use the GetLongPathName call to convert, but what if the
user has deactivated the creation of 8.3 file names?Isn't there a way to get
the Temp file name directly in a long file name format?Richard
 
Hello Richard!

I'm using the call
DWORD GetTempPath()
to get the temp folder on Win2K and XP. The call returns the folder name
using the 8.3 names, yet the value is stored in the System Properties ENV
variables as long file name format.I really don't want to show users a 8.3
file name.
<snip>

Since it's not sure that the user has write priviledges to the temp path. I
would suggest that you look up: SHGetFolderPath( NULL, CSIDL APPDATA, NULL,
0, szAppData )

This will give you the path to the common repository for
application-specific data.

To use this function you need to install the Platform SDK.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/


Hope this will help you!

// Anders
 
Thanks.
I as using that call for other purposes already, but I never considered
puting temporary files there.
Does the Win XP auto disk cleanup routine look to delete temp files from the
app data folder?

Richard


Anders Eriksson said:
Hello Richard!


<snip>

Since it's not sure that the user has write priviledges to the temp path. I
would suggest that you look up: SHGetFolderPath( NULL, CSIDL APPDATA, NULL,
0, szAppData )

This will give you the path to the common repository for
application-specific data.

To use this function you need to install the Platform SDK.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/


Hope this will help you!

// Anders
gloves.
 
Back
Top