PDG_TEMP or workaround

   1398   2   2
User Avatar
Member
72 posts
Joined:
Offline
Hi All,

I need to create temp batch files for a very particular problem (can't use any of the python process or os defs to substitute for the batch files).

So I wanted to store the batchfiles in PDG_TEMP, and write it's path to an attribute, but whatever I try it won't unpack $PDG_TEMP, __PDG_ETMP__ or os.environ to a path I can use to store the batch file.

I use a python processor to build the batch files.
Is there some limitation on how to read the TEMP dir? Is there a workaround, am I using the wrong nodes?

Thanks!
-Johan
Edited by Johan Boekhoven - May 29, 2020 11:19:51
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
__PDG_TEMP__ is only really used for commands on jobs that run out of process where the $PDG_TEMP environment variable is automatically defined.

If you want to use it in-process, you'll have to use the scheduler python API

work_item.node.scheduler.localizePath('__PDG_TEMP__')
# Or
work_item.node.scheduler.tempDir(True)
User Avatar
Member
72 posts
Joined:
Offline
Thanks Chris,

This works for my needs thanks!
I think a lot of us would be very greatful with a lot more example files and documentation.
I know it's such a broad scope, but some more use cases would be great!

Again thanks!
-Johan
  • Quick Links