I'm working on a program which will generate some temporary files, wait for the user's input on a few things, then use these temporary files for an operation.
I was wondering if I can reliably expect that these temporary files will not go away before I am completely done with them (e.g. will they disappear while the user is working?).
Obviously, I could create my own folder in my appdata and use that for temporary files. But it would be easier to use C#'s Path.GetTempFileName()
or Path.GetTempPath() + somename
. When would files created in this way be removed?
To clarify, I'm not looking for how to create temporary files, but rather how long temporary files created in GetTempPath()
are kept, and whether or not that would be long enough to wait for user input before using them.