How to enumerate all the files in a specified directory?

API

Use readDirectory or readDirectoryRecursively methods of the \Magento\Framework\Filesystem\Driver\File class:


Usage examples