Bert
also see sys(2015) in the help file.
Bert <no_...@thank.you> wrote in message
news:38840b1a...@news.pipeline.com...
>
Bert
Try this:
DECLARE LONG GetTempPath IN KERNEL32 ;
LONG @lnPathLen, ;
STRING @lcTempPath
LOCAL lcTmpPath,lnSize
lcTmpPath = SPACE(50)
lnSize = 256
=GetTempPath(128,@lcTmpPath)
WAIT WINDOW lcTmpPath
--OR--
WAIT WINDOW GETENV("TEMP")
HTH,
--Paul
Bert <no_...@thank.you> wrote in message
news:38840b1a...@news.pipeline.com...
Rick
"Bert" <no_...@thank.you> wrote in message
news:38844eb8...@news.pipeline.com...
> SYS(2023) gives the temporary directory used by VFP; I'm looking for
> the temporary directory used by Windows. SYS(2015) doesn't appear to
> be relevant at all -- was that a typo? Thanks anyway.
>
> Bert
>
> "Wizard Gene" <gene_...@email.msn.com> wrote:
>
> >Is sys(2023) what your are looking for ??
> >
> >also see sys(2015) in the help file.
> >
> >
> >
> >
John.
Bert <no_...@thank.you> wrote in message
news:38840b1a...@news.pipeline.com...
--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
"John Carter" <jo...@foxstreet.demon.co.uk> wrote in message
news:948218752.26420.0...@news.demon.co.uk...
John.
Cyrus Welch <cyw...@hotmail.com> wrote in message
news:862bn6$i...@chronicle.concentric.net...
Bert
"Paul Borowicz" <paul_b...@provide.net> wrote:
>Bert:
>
>Try this:
>
>DECLARE LONG GetTempPath IN KERNEL32 ;
>LONG @lnPathLen, ;
>STRING @lcTempPath
>
>LOCAL lcTmpPath,lnSize
>
>lcTmpPath = SPACE(50)
>lnSize = 256
>
>=GetTempPath(128,@lcTmpPath)
>
>WAIT WINDOW lcTmpPath
>
>--OR--
>
>WAIT WINDOW GETENV("TEMP")
>
>HTH,
>
>--Paul
>
>
Bert
"Cyrus Welch" <cyw...@hotmail.com> wrote:
>Does not windows always create an environment variable called TEMP that
>points to the temp path? If that is correct (and thats what I have seen)
>then GETENV("TEMP") would give it to you.
>
>--
>Cy Welch
>Senior Programmer/Analyst
>MetSYS Inc
>"John Carter" <jo...@foxstreet.demon.co.uk> wrote in message
>news:948218752.26420.0...@news.demon.co.uk...
>> The api function GetTempPath() looks like what you need.
>>
>> John.
>>
declare integer GetTempPath in win32api integer, string
lcTempPath=space(100)+chr(0)
?GetTempPath(100,@lcTempPath) && the @ is v. important or you will get empty
string
* remove trailing chr(0)
?left(lcTempPath,at(chr(0),lcTempPath)-1)
if you use getenv(), one day someone will break your code by:
set temp=c:\non_existent_folder
in their autoexec.bat
John.
Bert <no_...@thank.you> wrote in message
news:3887c671...@news.pipeline.com...
Bert
--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
"John Carter" <jo...@foxstreet.demon.co.uk> wrote in message
news:948232015.20260.0...@news.demon.co.uk...
--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
"Bert" <no_...@thank.you> wrote in message
news:3888e0f8...@news.pipeline.com...
> Thanks for the heads-up, John (and the code). You seem to imply that
> Windows doesn't look at the TEMP variable when deciding what to use as
> the temporary directory -- is that correct? Do you know off the top of
> your head what happens if someone deletes the temporary directory that
> Windows uses -- does Windows recreate it?
>
> Bert
>
> "John Carter" <jo...@foxstreet.demon.co.uk> wrote:
>
I'll try later.
The api call and sys(2023) ignore the temp envvar under most circumstances.
They always refer to c:\windows\temp.
Delete the temp folder and both give the vale of getenv("temp").
When the temp emvvar is invalid it uses the current folder for both.
So it looks like the api call is the safest.
John.
Cyrus Welch <cyw...@hotmail.com> wrote in message
news:862pt8$s...@chronicle.concentric.net...
> They will also break windows since it actually uses that env variable for
> its temp path. If you change that variable windows puts its temp files
> wherever you point it. Maybe you might want to add code to check it to
make
> sure its valid, but I believe what you would get from the OS would be the
> same as the variable.
>
> --
> Cy Welch
> Senior Programmer/Analyst
> MetSYS Inc
> "John Carter" <jo...@foxstreet.demon.co.uk> wrote in message
> news:948232015.20260.0...@news.demon.co.uk...
--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
"John Carter" <jo...@foxstreet.demon.co.uk> wrote in message
news:948308353.9810.0...@news.demon.co.uk...
> I would assume it doesn't use the temp envvar (I'm sure its in the
registry
> somewheres). I would hope that it recreates it, but knowing MS... :-)
>
> I'll try later.
>
> John.
>
> Bert <no_...@thank.you> wrote in message
> news:3888e0f8...@news.pipeline.com...
> > Thanks for the heads-up, John (and the code). You seem to imply that
> > Windows doesn't look at the TEMP variable when deciding what to use as
> > the temporary directory -- is that correct? Do you know off the top of
> > your head what happens if someone deletes the temporary directory that
> > Windows uses -- does Windows recreate it?
> >
> > Bert
> >
> > "John Carter" <jo...@foxstreet.demon.co.uk> wrote:
> >