Is FindFirst,FindNext & FindClose Thread safe in delphi ? If not what should be used in there place ?
+13
A:
FindFirst, FindNext & FindClose use API calls and they are Thread safe. Every thread must use its own API handle for file access.
GJ
2009-10-22 09:29:26
No, they are not API calls. Go see for yourself in *SysUtils.pas*.
Rob Kennedy
2009-10-22 13:10:07
Yes you right but use API calls and all local variables are stored on the stack except TSearchRec. So if you don't share the TSearchRec between threads it is Thread safe.
GJ
2009-10-22 13:53:47
edited to address Rob's comment
Argalatyr
2009-10-23 00:06:44
+5
A:
If you don't use a shared TSearchRec variable the routines are thread safe.
Tihauan
2009-10-22 09:34:55