diff --git a/mdl/m_fileio.pas b/mdl/m_fileio.pas index 0f282c5..163bb9c 100644 --- a/mdl/m_fileio.pas +++ b/mdl/m_fileio.pas @@ -38,6 +38,7 @@ Function DirChange (Dir: String) : Boolean; Procedure DirClean (Path: String; Exempt: String); Function FileRename (OldFN, NewFN: String) : Boolean; Function FileCopy (Source, Target: String) : Boolean; +Function FileFind (FN: String) : String; { GLOBAL FILEIO VARIABLES AND CONSTANTS } @@ -725,4 +726,24 @@ Begin FreeMem (TempBuf, RecordSize); End; -End. +Function FileFind (FN: String) : String; +Var + Dir : SearchRec; +Begin + Result := FN; + + FindFirst (JustPath(FN) + '*', AnyFile, Dir); + + While DosError = 0 Do Begin + If strUpper(Dir.Name) = strUpper(JustFile(FN)) Then Begin + Result := JustPath(FN) + Dir.Name; + Break; + End; + + FindNext(Dir); + End; + + FindClose(Dir); +End; + +End. \ No newline at end of file