When you package up a GP model into a GPK for Runtime, output paths for data are changed. In the case of a folder they'll be changed to %scratchFolder%\filename.txtThis ensures that when running this GPK, the file can be generated in the appropriate place without fear of overwriting an existing one.The Runtime works in a similar manner to Server.With Server, each GP Service will usually execute to C:\arcgisserver\directories\arcgisjobs\<service>_gpserver\guidWith Runtime, it uses the TEMP directory as you point out.My suggestion - let it write the file there as its doing. This is safe and will always work. If you want to persist the file somewhere else use some code to either copy the file to another location or give the user and option to save the file to a directory of their choice.