mtmp:=Getenv("TEMP")

mtmp:=Getenv("TEMP")

Postby jacquet philippe » Fri Jun 30, 2006 11:57 am

I use this function and do'nt receive the same result.
===
Under win2000 it return the temp directory of the user c:\documents and setting .....

Under Win XP it return c:\windows\temp

How to return the temp directory of the user with WinXp .
jacquet philippe
 
Posts: 22
Joined: Fri Nov 04, 2005 9:05 pm
Location: LIEGE Belgium

Re: mtmp:=Getenv("TEMP")

Postby Enrico Maria Giordano » Fri Jun 30, 2006 2:55 pm

It depends on local settings. In my XP I get c:\documents and setting ... It is the default setting.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8378
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby jacquet philippe » Fri Jun 30, 2006 7:35 pm

With Fivewin and clipper , it return c:\windows\temp

With xharbour and fivewin, it return c:\documents and setting ....


Strong ! 16 and 32 bit !!
jacquet philippe
 
Posts: 22
Joined: Fri Nov 04, 2005 9:05 pm
Location: LIEGE Belgium

Postby Enrico Maria Giordano » Fri Jun 30, 2006 9:35 pm

Ops, I was not aware to be in the Fivewin for Clipper forum. Yes, I tried with FWH. With Clipper I get c:\windows\temp.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8378
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Mdandrea » Sun Jul 02, 2006 3:51 pm

Or you can use the following API call to get the windows temp folder
function get_temp()
local tbuffer:=space(256)

gettemppath(256,@tbuffer)
tbuffer := LEFT(tbuffer,AT(CHR(0),tbuffer)-1)
return(tbuffer)

DLL32 Function GetTempPath( bufferlen as LONG, tbuffer AS LPSTR) AS LONG ;
PASCAL FROM "GetTempPathA" LIB "kernel32.dll"
Mdandrea
 
Posts: 21
Joined: Wed Nov 23, 2005 12:24 am

Postby jacquet philippe » Tue Jul 04, 2006 8:04 am

I have the same result with the api,
it return windows\temp and not the user tem path .

??
jacquet philippe
 
Posts: 22
Joined: Fri Nov 04, 2005 9:05 pm
Location: LIEGE Belgium

Postby Antonio Linares » Tue Jul 04, 2006 7:01 pm

Philippe,

It is a Windows issue. Under 16 bits GetEnv( "TEMP" ) returns "c:\windows\temp" and under 32 bits GetEnv( "TEMP" ) return "c:\documents and settings\<username>\...\temp"

Even if you try it this way, you get the different results:
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local cValue := Space( 256 )

   MsgInfo( GetEnv( "TEMP" ) )
   
   GetEnvironmentVariable( "TEMP", cValue, Len( cValue ) )
   
   MsgInfo( cValue )
   
return nil

DLL32 FUNCTION GetEnvironmentVariable( cName AS LPSTR, cValue AS LPSTR, nLen AS LONG ) ;
   AS LONG PASCAL FROM "GetEnvironmentVariableA" LIB "kernel32.dll" 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41408
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Mdandrea » Wed Jul 05, 2006 5:42 pm

jacquet philippe wrote:I have the same result with the api,
it return windows\temp and not the user tem path .

??


That's strange under Win 2000 i get the user temp path, I am however logged in as an admin of the local machine.
Mdandrea
 
Posts: 21
Joined: Wed Nov 23, 2005 12:24 am


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 1 guest