see my comment above about writing your code in a way that won't require you to create temporary files