Please enable JavaScript to view this site.

Codolex

Navigation: Activities > File system

Listing file/folder

Scroll Prev Top Next More

The listing file/folder activity list all the files or folder in a directory

uses System.IOUtils.TDirectory.GetDirectories

uses System.IOUtils.TDirectory.GetFiles

 

listingFileFolder

Activity properties

 

begin

var FileList: ICodolexList<string>;

 FileList := TCodolexCollections.CreateList<string>;

 FileList.AddRange(TDirectory.GetFiles('C:\...\Codolex\Documentation'));

end;

Resulting code

 

When the option 'Folder' is selected, only folders will be listed.

When the option 'File is selected, only files will be listed.

 

When a non-valid path is provided, a EDirectoryNotFoundException is thrown

© by GDK Software