TemporaryFile suggestion

Hello Jules,

I was trying to use the TemporaryFile class to do a safe file save in a sandboxed application. It turns out that this is currently impossible, since the constructor that accepts the target file reference tries to create the temporary file inside the same folder of the target, a thing that in a sandboxed application fails.

I would suggest to add a setTargetFile() method, so that it is possible to use the other constructor to create a randomly named file inside the application container, then set the target file, and finally use overwriteTargetFileWithTemporary().

Good idea - I’ve added that now.

Great, thanks!