VishalMistry
27th January 2010, 11:46
Hi,
I use bse.tmp.dir$() to get temp folder on server. Can anybody guide which function I can use to get path of temporary folder on client machine ?
Regards,
Vishal
george7a
27th January 2010, 13:38
I once used a small Dos application (or batch file) and fetched the %TEMP% environment variable..
_Ralph_
27th January 2010, 13:42
I do not no any function that do such a thing,
what you can do is create the a new directory on the client using create.local.directory()
MilindV
27th January 2010, 13:44
Hi Vishal,
Try this function. This will not give you the temp directory, but you can create one temp directory yourself.
create.local.directory (string dirent)
This creates a specified directory on a client system. You must have write permission in the parent directory to do this. Access permissions for the new directory are set to read and write for all users.
Thanks
MilindV
rahul.kolhe22
28th January 2010, 06:44
Hi Vishal,
Please try using as follow:
string path(100)
path = "${TMP}"
Here the variable "path" contains the value set for enviournment variable TMP. It works for me.
Hope it helps.
Regards,
--Rahul
NPRao
30th January 2010, 01:43
Vishal,
If you are on LN Tools, you can use the tools function -
create.local.file()
Syntax:
function long create.local.file (string filename)
Description
This creates a specified file on a client system. You must have write permission in the parent directory to do this. Access permissions for the new file are set to read and write, for all users. When the file does already exist, it will be truncated.
Arguments
string filename The full path name of the file. For example: create.local.file("C:\Program Files\mydir\myfile") The filename parameter may include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of Webtop.
Return values
0 Success.
<>0 Error. Probably no permission.
Context
This function can be used in all script types.
If you are on older Baan version you can use this code -
function main()
{
long fp, fsize, lret
boolean bret
string buffer(1024), ofile(128)
ofile = "C:\checkenv_" & str$(random()) & ".out"
bret = start.application.local("cmd /c echo %temp%" & " > " & ofile, true, lret)
fp = seq.open.local(ofile, "rt", 1)
if fp > 0 then
e = seq.read.local(buffer, fsize, fp)
endif
seq.close.local(fp)
message("Local_Temp=%s", buffer)
}