Hi,
sorry for my bad english.
I'm using fpc 3.0.4.
See this code:
procedure TestFindFirst(WrkDir:String);
var PathInfo: TSearchRec;
begin
SysUtils.FindFirst(AppendPathDelim(WrkDir) + GetAllFilesMask, faDirectory, PathInfo);
SysUtils.FindClose(PathInfo);
{$IFDEF MSWINDOWS}
if (PathInfo.FindHandle <> -1) then begin
{$ENDIF}
{$IFDEF Linux}
if (PathInfo.FindHandle <> nil) then begin
{$ENDIF}
ShowMessage('Error !!!');
end else begin
ShowMessage('Ok ');
end;
Halt;
end;
On Linux, using TestFindFirst, passing an existing directory, the value of "PathInfo.FindHandle" is nil.
On Windows, using TestFindFirst, passing an existing directory, the value of "PathInfo.FindHandle" that i expecting is -1, but result is the same value that it had before the call of "FindClose".
It's a bug?
Thanks in advance, Mario