Focal Point
Referencing the temporary directory

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6331067331

August 20, 2003, 03:07 PM
focusqueen
Referencing the temporary directory
Let's imagine for a moment that I have a focus program that creates an HTML file. I'd like to save this HTML file to the edatemp directory and then call this HTML file into another web page. When I look at the path, I can see that the tempdir is called F:\ibi\srv51\wfs\edatemp\ts000430. Now of course the number at the end will change with different sessions so it can't be referenced directly in the FILEDEF at the top of the .fex file nor in the HTML file that I'd like to use it as a source in. How would I reference this file in the temporary directory both in the FILEDEF and the HTML file? Any ideas? Thanks!
August 22, 2003, 01:57 PM
<Grzegorz>
I do not know if it is exactly what are you asking from, but you can use the APP capability:

-* Assuming APP ENABLE is already performed
-* (within the edasprof.prf for instance)
-*
-* Setting the hold directory:
-SET &HLDDIR = 'F:\ibi\apps\anyapp';
-*
APP MAP HOLDDIR
APP MAP HOLDDIR &HLDDIR
APP HOLD HOLDDIR
-*
-* Running the report:
-INCLUDE REPORT_WITH_HOLD
-*
-* Returning to the default temporary directory:
-* (if necessary)
APP HOLD
-*
-* Any other FOCUS requests
-* ...

Hope this Helps
Grzegorz
August 26, 2003, 02:45 AM
<Kyle>
The quick answer is use the TEMPPATH function:

-SET &TEMPPATH = TEMPPATH(100,'A100');

This will return the current agents temporary directory, ie, D:\ibi\srv52\wfs\edatemp\ts000001\

The real question is why do you want this? Any hold files you create are automatically filedef'd when you create them in a given request. If you are trying to create the file in one request and access it in a separate request, don't use the default temporary directories. These directories are automatically cleared and reused among multiple requests. There is no guarantee it will work every time.
October 29, 2003, 01:10 PM
susannah
the temppath method totally rocks! i use it liberally all thru my systems
FILEDEF HOLDMAST DIR &TEMPPATH
...then
FILEDEF HOLDMAST DIR D:\IBI\APPS\blah blah.

ONE NOTE: don't do this!
FILEDEF HOLDMAST DIR &TEMPPATH
TABLE FILE LALA
..some code
ON TABLE HOLD
END
FILEDEF HOLDMAST DIR D:\IBI\APPS\real path
TABLE FILE HOLD
..some code
ON TABLE HOLD AS MYREALFILE
END
...its that HOLD business. focus will pick up any existing HOLD.MAS from your real path directory and use it to read your HOLD file in your agent. yikes!
so you gotta always ON TABLE HOLD AS HTEMP
or some tempfilename you like to use,
BEFORE switching your FILEDEF HOLDMAST DIR...