Use Tmpdir and move file there to work on it. Hopefully it wont get garbage collected too fast..