Skip to content
DirGetContents

DirGetContents

Description

Read directory contents into a vector.

Parameters

Name Direction Description
path in Path of directory. Prefer Str *; Zstr accepted for literals / borrowed buffers.
alloc in Allocator backing the returned vector + entry names (omit inside a Scope block to use MisraScope).

Success

DirContents vector filled with directory contents data.

Failure

Returns empty vector on read error.

Usage example (Cross-references)

Usage examples (Cross-references)
    #    endif
        if (fd < 0) {
            LOG_SYS_ERROR(ErrnoOf(fd), "DirGetContents: open(\"{}\")", path);
            return dc;
        }
            }
            if (n < 0) {
                LOG_SYS_ERROR(ErrnoOf(n), "DirGetContents: getdents64");
                break;
            }
Last updated on