Recent

Author Topic: Bug in "FindFirst" ?  (Read 730 times)

bonmario

  • Sr. Member
  • ****
  • Posts: 268
Bug in "FindFirst" ?
« on: May 24, 2018, 08:57:32 am »
Hi,
sorry for my bad english ....
in the company where I work, we have a Microsoft Windows network.
Unfortunately I do not know the details, because I do not deal with that.

Today I noticed that, if I recall the procedure below, passing as a parameter the name of an existing directory on the network, and then I check the system operators if there is any lock on the directory passed as a parameter, the result of the check is that directory is allocated by me.

Quote
procedure TestFindFirst(WrkDir:String);
var PathInfo: TSearchRec;
begin
  try
    SysUtils.FindFirst(AppendPathDelim(WrkDir) + GetAllFilesMask, faDirectory, PathInfo);
  finally
    SysUtils.FindClose(PathInfo);
  end;
end;

I think the command they launch to do the verification is "OpenFile", but I do not know with which parameters.

Has anyone here already verified something like this?

Thanks in advance, Mario