Skip to main content
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 s1]. 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

 

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.


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.


Reply