find

Recursive Directory Traversal

Constants

FIND_DT_DIR = 4
FIND_DT_REG = 8

Functions

FunctionDescription
find_strlenInternal: strlen of null-terminated string.
find_copyInternal: copy bytes.
find_join_pathInternal: build full path “dir/name” into dst, return length.
find_is_dotInternal: is this “.” or “..”?
find_add_entryInternal: store a path in the result.
find_readdirInternal: read directory entries using getdents64.
find_walkRecursively walk a directory. Returns FindResult.
find_countNumber of entries found.
find_pathCopy path at index to dst. Returns length.
find_typeEntry type at index.
find_is_fileIs entry at index a regular file?
find_is_dirIs entry at index a directory?
find_filesWalk directory returning only files.

Details

find_strlen

fn find_strlen(s: &i8) -> i64

Internal: strlen of null-terminated string.

find_copy

fn find_copy(dst: &i8, doff: i64, src: &i8, soff: i64, len: i64)

Internal: copy bytes.

find_join_path

fn find_join_path(dir: &i8, dlen: i64, name: &i8, nlen: i64, dst: &i8) -> i64

Internal: build full path “dir/name” into dst, return length.

find_is_dot

fn find_is_dot(name: &i8) -> i64

Internal: is this “.” or “..”?

find_add_entry

fn find_add_entry(result: &i64, path: &i8, plen: i64, dtype: i64)

Internal: store a path in the result.

find_readdir

fn find_readdir(result: &i64, dir: &i8, dlen: i64)

Internal: read directory entries using getdents64.

find_walk

fn find_walk(dir: &i8, dlen: i64) -> &i64

Recursively walk a directory. Returns FindResult.

find_count

fn find_count(result: &i64) -> i64

Number of entries found.

find_path

fn find_path(result: &i64, idx: i64, dst: &i8) -> i64

Copy path at index to dst. Returns length.

find_type

fn find_type(result: &i64, idx: i64) -> i64

Entry type at index.

find_is_file

fn find_is_file(result: &i64, idx: i64) -> i64

Is entry at index a regular file?

find_is_dir

fn find_is_dir(result: &i64, idx: i64) -> i64

Is entry at index a directory?

find_files

fn find_files(dir: &i8, dlen: i64) -> &i64

Walk directory returning only files.