Skip to main content
Solved

Read in FME TEMP variable

  • November 23, 2015
  • 2 replies
  • 44 views

Forum|alt.badge.img
Hi,

 

 

I am looking for a way to obtain the FME TEMP directory. As far as I know, FME defines the TEMP directory based on 4 characteristics [1]. My question is: Using a C++ reader, can I get the path currently used as temp directory?

 

 

Something similar to:

 

fmeSession_->fmeHome() returns the home directory of the FME

 

? returns the TEMP directory of the FME.

 

 

 

Of course, I could try to read in the TEMP environment variable by myself (stored in Control Panel | System | Advanced | Environment Variables). But I think using FME for this would be a better solution.

 

 

Thanks

 

ben

 

 

[1] FME TEMP variable

 

Best answer by fmelizard

Sadly this is not part of our API at this point. I can tell you that what we do is look for FME_TEMP as an environment variable, and failing that, TEMP, then TMP, then TMPDIR. ANd if all that fails, we go for c:\\temp on windows and /tmp on unix.

But you can use an @Tcl2("return [FME_TempFilename a b]") (in a performFunction call on FME Feature) and you could then pick out the temp directory from that. And you should delete the file you get back as well.

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • Best Answer
  • November 27, 2015

Sadly this is not part of our API at this point. I can tell you that what we do is look for FME_TEMP as an environment variable, and failing that, TEMP, then TMP, then TMPDIR. ANd if all that fails, we go for c:\\temp on windows and /tmp on unix.

But you can use an @Tcl2("return [FME_TempFilename a b]") (in a performFunction call on FME Feature) and you could then pick out the temp directory from that. And you should delete the file you get back as well.


Forum|alt.badge.img
  • Author
  • December 2, 2015
fmelizard wrote:

Sadly this is not part of our API at this point. I can tell you that what we do is look for FME_TEMP as an environment variable, and failing that, TEMP, then TMP, then TMPDIR. ANd if all that fails, we go for c:\\temp on windows and /tmp on unix.

But you can use an @Tcl2("return [FME_TempFilename a b]") (in a performFunction call on FME Feature) and you could then pick out the temp directory from that. And you should delete the file you get back as well.

Thanks for your answer. Using TCL works good for me.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings