Johan Boekhoven
May 29, 2020 11:19:06
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
chrisgreb
May 29, 2020 11:33:28
__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)
Johan Boekhoven
May 29, 2020 11:49:23
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