Thanks Graeme,Its like what I do so it seems Im doing OK. I looked at
the code and it seems it just remove { and }.
> if (LValue[1] = '{') and    (LValue[cGUIDLength] = '}') then    LValue
> := Copy(lValue, 2, cGUIDLength - 2);  AAssignTo.AsString := LValue;

It seems it doesnt remove "-" .

> 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.

Yes I can but GUID is easier to use.
> I wasn't aware that GetTempFileName isn't threadsafe.
(Are you sure your code is correct?) Yea. If you look at the
implementation it just check until there isnt a file so if 2 thread get
a filename before they create it it cause a problem. In my case I made
100 thread and they will create temp file and use them,simple but some
time it will happen.

> var
   GUID : TGUID; begin if CreateGUID(GUID) = 0 then begin  MyFileName :=
   GuiDToString(Guid); end;

Thanks.

Regards, Ara


-- 
http://www.fastmail.com - mmm... Fastmail...

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to