× Tools, Runtimes binaries, Toolchains, OS Scripts and OS Libraries, discussions, problems and suggestion

Question Lazrus Fileutil Unit

  • Chad Adams
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 8 months ago #15143 by Chad Adams
Lazrus Fileutil Unit was created by Chad Adams
How can i get the Lazarus fileutil unit to work in CodeTyphoon (or is there some alternative unit?)

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
1 year 8 months ago - 1 year 8 months ago #15147 by Sternas Stefanos
Replied by Sternas Stefanos on topic Lazrus Fileutil Unit
just
add lazfileutils to your unit
look at codetyphon\typhon\components\BaseUtils\
folder

PilotLogic Architect and Core Programmer
Last edit: 1 year 8 months ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

More
4 months 2 weeks ago #16717 by Kristof Subryan
Replied by Kristof Subryan on topic Lazrus Fileutil Unit
I found a memory leak in fileutil.inc
in
procedure TFileSearch.Search(const ASearchPath: Stringl const ASearchMask: String; .....

begin
  if FSearching then RaiseSearchingError;
  {$ifdef windows}
  MaskList := TWindowsMaskList.Create(ASearchMask, FMaskSeparator, CaseSensitive);
  {$else}
  MaskList := TMaskList.Create(ASearchMask, FMaskSeparator, CaseSensitive);
  {$endif}
  MaskList := TMaskList.Create(ASearchMask, FMaskSeparator, CaseSensitive);        <
  LEAK!!!!!
  // empty mask = all files mask

 

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 months 2 weeks ago - 4 months 2 weeks ago #16719 by Sternas Stefanos
Replied by Sternas Stefanos on topic Lazrus Fileutil Unit
Thanks Sir
we will test and fix

We fix this in CT 7.7 Final

  if FSearching then RaiseSearchingError;
  {$ifdef windows}
  MaskList := TWindowsMaskList.Create(ASearchMask, FMaskSeparator, CaseSensitive);
  {$else}
  MaskList := TMaskList.Create(ASearchMask, FMaskSeparator, CaseSensitive);
  {$endif}
  // empty mask = all files mask
  if MaskList.Count = 0 then
    FreeAndNil(MaskList);

PilotLogic Architect and Core Programmer
Last edit: 4 months 2 weeks ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.