'How do I tell Jenkins to automatically create @tmp directories?

I'm using Jenkins on Windows with the Windchill RV&S (Integrity) configuration management plugin. I've noticed that from time to time, it deletes the @tmp directories for project workspaces, but it won't recreate them. i.e. if I have this directory structure:

C:\PTC\workspace\Project1
C:\PTC\workspace\Project1@tmp

Then sometimes the build will fail when C:\PTC\workspace\Project1@tmp goes missing. I don't know why Jenkins deletes it. Maybe it happens when I enable the cleanCopy option in my pipeline? The build failure message is usually something like this:

C:\PTC\workspace\Project1\build>make
..\..\path\to\compiler  ..\..\path\to\source_file.c
#error compiler ..\..\path\to\source_file.c:0 can't create C:\PTC\workspace\Project1@tmp\s634.cx1
..\..\path\to\source_file.c:
make: Error code 1 

So I re-create C:\PTC\workspace\Project1@tmp manually and the build works again. How do I tell Jenkins to create these @tmp directories automatically?

Edit: My builds are happening daily (@midnight). They'll work fine for about a month or so, and then on the same day, all the @midnight builds will fail. Each @midnight build will lose its respective @tmp directory and every file in its workspace will be gone (but all the directories will remain). To recover from this, I have to manually recreate the @tmp directory and specify the cleanCopy option (otherwise Windchill RV&S won't restore the missing files in the empty workspace directories).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source