FileFind function

This commit is contained in:
mysticbbs 2012-08-16 23:09:22 -04:00
parent 414701de6b
commit c47f37a84a
1 changed files with 22 additions and 1 deletions

View File

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