var sr : TSearchRec; tim : TSystemTime; dDate : TDate; sMask : string; begin .. { mask for .png files only } sMask := gcsDrawingDirectory + sFocusedValue + '*' + '.png'; { find first file, to sr } i := FindFirst( sMask , faAnyFile, sr ); while i = 0 do begin try { here is some action with file -> here get file time } FileTimeToSystemTime( FileTime( sr.FindData.ftLastWriteTime) , tim ); dDate := EncodeDate( tim.wYear, tim.wMonth, tim.wDay ); { do some action..} except end; { try find next file } i := FindNext( sr ); end; { close finding } FindClose( sr );
Microsoft AX 2012, X++, C#, SQL server, SSRS, Java, JavaFX, Oracle, PL/SQL, Delphi - codes examples, step-by-step tutorials, experiences.
Thursday, December 7, 2017
DELPHI - How enumerate all files in directory
This example enumerate all *.png files in directory (..and get its system date info).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment