Recent

Author Topic: GetTempDir bug?  (Read 2259 times)

kpeters58

  • Sr. Member
  • ****
  • Posts: 267
GetTempDir bug?
« on: March 05, 2015, 08:33:52 pm »
  showmessage(GetTempDir(False) + #13 + GetTempDir(True));   

returns user's local temp dir in both cases....

Windows 7 Prof., Laz 1.2.6

Do others see this as well?

Thanks,
Kai
Lazarus 2.0.4/FPC 3.0.4/Win 64

Windsurfer

  • Sr. Member
  • ****
  • Posts: 368
    • Windsurfer
Re: GetTempDir bug?
« Reply #1 on: March 05, 2015, 08:46:11 pm »
I see /tmp/ and /tmp/ on an i7 PC with Linux Mint 17.1, Laz 1.4RC1 and GTK2 widget set.

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: GetTempDir bug?
« Reply #2 on: March 05, 2015, 09:28:04 pm »
See implementation, on Windows it just checks for %TEMP% or %TMP%.

Bart

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: GetTempDir bug?
« Reply #3 on: March 06, 2015, 04:42:44 am »
  showmessage(GetTempDir(False) + #13 + GetTempDir(True));   

returns user's local temp dir in both cases....

Windows 7 Prof., Laz 1.2.6

Do others see this as well?

Thanks,
Kai

It is not a bug at all.
In windows
GetTempDir will always return users temp directory

Actually there are two temp directories, one is user temp dir and other is C:\Windows\TEMP

GetTempPath
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364992%28v=vs.85%29.aspx

The GetTempPath function checks for the existence of environment variables in the following order and uses the first path found:

    The path specified by the TMP environment variable.
    The path specified by the TEMP environment variable.
    The path specified by the USERPROFILE environment variable.
    The Windows directory.
Holiday season is online now. :-)

 

TinyPortal © 2005-2018