Skip to main content

get_default_cache_folder

Function get_default_cache_folder 

Source
pub fn get_default_cache_folder() -> PathBuf
Expand description

Returns the default cache folder path.

The cache folder is determined in the following priority order:

  1. BBCLIENT_CACHE environment variable if set
  2. $HOME/.bbcache/ if home directory is available
  3. /tmp/.bbcache/ as a fallback

§Returns

A PathBuf pointing to the cache folder location.

§Examples

use gtars_bbcache::utils::get_default_cache_folder;

let cache_path = get_default_cache_folder();
println!("Cache will be stored at: {:?}", cache_path);

§Environment Variables

  • BBCLIENT_CACHE: Custom cache directory path (highest priority)
  • HOME: User’s home directory (used for default location)