Function cc2p::find_files

source ·
pub fn find_files(pattern: &str) -> Vec<PathBuf>
Expand description

Searches for files matching the given pattern.

§Arguments

  • pattern - A string slice representing the search pattern.

§Returns

A vector of PathBuf representing the paths of the matching files.

§Panics

This function will panic if it fails to read the file search pattern.

§Examples

use std::path::PathBuf;
use cc2p::find_files;

let pattern = "testdata/sample*.csv";
let files = find_files(pattern);

for file in files {
    println!("{:?}", file);
}