Funktion FindLastWrittenFile (Dir, Suche: Schnur): Schnur;
Var
R: TSearchRec;
LastWrite, LastWriteAllFiles: TDateTime;
anfangen
Dir: =IncludeTrailingBackslash (Dir);
LastWriteAllFiles: =0;
Resultat: = '';
wenn FindFirst (Dir+Search, faAnyFile-faDirectory, R)=0 dann
Wiederholung
LastWrite: = FileTimeToDTime (R.FindData.ftLastWriteTime); ;
wenn LastWrite>LastWriteAllFiles dann
anfangen
LastWriteAllFiles: =LastWrite;
Resultat: =R.Name;
Ende;
bis FindNext (R)<> 0;
FindClose (R);
Ende;
|