On February 3, 2015 7:32:37 PM EST, Niall Douglas
On 3 Feb 2015 at 18:54, Rob Stewart wrote:
Given all of the restrictions you've enumerated, it would seem that the right behavior is actually to test the existence of a possible result and the caller's permission to use it before returning.
I think it's faster to iterate all ten in that order actually. The big problem with caching results is that if your temp drive is on a network share, it can come and go over the lifetime of your process.
In the end, temp files are slow on Windows, as is opening file handles at all actually. That's because on NT you were never supposed to use temp files when you have a NT kernel namespace to use (i.e. named section objects). Unfortunately, those don't play well without a bit of work with iostreams, fopen et al.
I don't understand your response given what I wrote. I meant that those options would be tried in order to see if they resolve to a valid directory the caller has permissions to use and, if not, try the next. I'll grant that a network resource may be transient, but that can't be helped. ___ Rob (Sent from my portable computation engine)