klyn.io.DirectoryReader.DirectoryReader
constructor
public DirectoryReader(
folder as FolderPath,
includeFileNames as Boolean = true,
includeFileBytes as Boolean = false,
followSymlinks as Boolean = false
) throws IOException
Description

Opens a streaming cursor on a directory.

Parameters
ParameterDescription
folderDirectory to enumerate.
includeFileNamesRetain regular file names in DirectoryBatch.fileNames.
includeFileBytesAccumulate logical file sizes in DirectoryBatch.bytes.
followSymlinksFollow symbolic links instead of counting them as skipped.
Throws
  • ValueException If folder is null.
  • IOException If the directory does not exist or cannot be opened.
Example
import klyn.io

try reader = DirectoryReader(Path.cwd):
    batch = reader.read(128)
    print(batch.files)