[Lazarus] Safe temp file name

Tony Whyman tony.whyman at mccallumwhyman.com
Wed Nov 25 15:58:43 CET 2015

This may be an appropriate use for EnterCriticalSection and 
ExitCriticalSection, although why don't you just use a different 
"prefix" in the call to GetTempFile for each thread.

On 25/11/15 13:51, Aradeonas wrote:
> Hi,
> I used GetTempFileName in a multi thread system and it causes problems 
> as you guess already.
> So the best way in my mind is using GUID and maybe use it in a loop 
> for checking not existing for extra safety.
> But I want to know is there any clean implementation already that I 
> dont know of?
> Regards,
> Ara
> -- 
> http://www.fastmail.com - The way an email service should be
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151125/271936cd/attachment-0003.html>

More information about the Lazarus mailing list