> Turned out that the application was writing a bunch of tempfiles into the cwd and then immediately deleting them.
> I worked around the issue by making the application reuse tempfile names.
Knowing nothing about the issue beyond what you've written here...
why not make the application create a directory for its tempfiles, and then remove that directory along with the tempfiles?