Function next [src]

Memory such as file names referenced in this returned entry becomes invalid with subsequent calls to next, as well as when this Dir is deinitialized.

Prototype

pub fn next(self: *Self) Error!?Entry

Parameters

self: *Self

Possible Errors

AccessDenied IteratorError
InvalidUtf8 IteratorError

WASI-only. The path of an entry could not be encoded as valid UTF-8. WASI is unable to handle paths that cannot be encoded as well-formed UTF-8. https://github.com/WebAssembly/wasi-filesystem/issues/17#issuecomment-1430639353

SystemResources IteratorError
Unexpected UnexpectedError

The Operating System returned an undocumented error code.

This error is in theory not possible, but it would be better to handle this error than to invoke undefined behavior.

When this error code is observed, it usually means the Zig Standard Library needs a small patch to add the error code to the error set for the respective function.

Source

pub fn next(self: *Self) Error!?Entry { switch (native_os) { .macos, .ios => return self.nextDarwin(), .freebsd, .netbsd, .dragonfly, .openbsd => return self.nextBsd(), .solaris, .illumos => return self.nextSolaris(), else => @compileError("unimplemented"), } }