FileFind function
This commit is contained in:
parent
414701de6b
commit
c47f37a84a
|
@ -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;
|
||||
|
||||
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.
|
Loading…
Reference in New Issue