Function glob

Source
pub fn glob(
    pattern: &str,
    result: &mut Vector<String>,
    recursive: bool,
) -> Result<()>
Expand description

Searches for files matching the specified pattern in a directory.

This function searches for files that match a given pattern (e.g., *.jpg) in the specified directory. The search can be limited to the directory itself or be recursive, including subdirectories.

§Parameters

  • pattern: The file search pattern, which can include wildcards like * (for matching multiple characters) or ? (for matching a single character).

  • result: Output vector where the file paths matching the search pattern will be stored.

  • recursive: (optional) Boolean flag indicating whether to search subdirectories recursively. If true, the search will include all subdirectories. The default value is false.

§C++ default parameters

  • recursive: false