diff options
-rw-r--r-- | lowlevelunit.pas | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas index e87e383..59bad32 100644 --- a/lowlevelunit.pas +++ b/lowlevelunit.pas @@ -184,6 +184,8 @@ function unEscapeCommas(s: string): string; function escape(s,toe,es: string): string; function escapeStringToRegex(s: string; typ: tRegexTyp; extras: string = ''): string; inline; +function findeRekursiv(pfad,muster: string; out datei: string): boolean; + var base64Chars: array[0..63] of char; base64CharsInvers: array[char] of byte; @@ -1515,6 +1517,33 @@ begin end{of case}; end; +function findeRekursiv(pfad,muster: string; out datei: string): boolean; +var + sr: tSearchRec; + err: integer; +begin + result:=false; + err:=findFirst(pfad+'/'+muster,faAnyFile and not faDirectory,sr); + while (err=0) and not result do begin + if (sr.attr and faDirectory)=0 then begin + result:=true; + datei:=pfad+'/'+sr.name; + break; + end; + err:=findNext(sr); + end; + findClose(sr); + if result then + exit; + err:=findFirst(pfad+'/*',faAnyFile,sr); + while (err=0) and not result do begin + if (sr.name<>'.') and (sr.name<>'..') and ((sr.attr and faDirectory)<>0) then + result:=findeRekursiv(pfad+'/'+sr.name,muster,datei); + err:=findNext(sr); + end; + findClose(sr); +end; + var b: byte; |