Skip to main content

find_faf_file

Function find_faf_file 

Source
pub fn find_faf_file<P: AsRef<Path>>(start_dir: Option<P>) -> Option<PathBuf>
Expand description

Find FAF file starting from given directory, walking up to parents

Searches for project.faf (modern) or .faf (legacy) in the starting directory and up to 10 parent directories.

§Example

use faf_kernel::find_faf_file;
use std::path::PathBuf;

// Search from current directory
if let Some(path) = find_faf_file::<PathBuf>(None) {
    println!("Found FAF at: {}", path.display());
}

// Search from specific directory
if let Some(path) = find_faf_file(Some("/path/to/project")) {
    println!("Found FAF at: {}", path.display());
}