Lyricdev
GitHub

class ReadDirIter

pub class ReadDirIter :: [Iterator, Closeable]

Conforms to Iterator, Closeable.

A directory's entries, from readDir. After its end or an error it gives no more; after close() a call throws Closed.

Methods

pub mut fn next(): ?DirEntry throws IoError

Returns the next entry, or null at the end.

Errors

Throws IoError with the directory's path: Closed after close(), InvalidData for a name that is not UTF-8, else the system's failure to read.

pub fn close(): void throws IoError

Closes the directory before the end. A second close does nothing.

Errors

Throws IoError with the path when the system fails to close it.