pub fn ensure_user_cache_dir(path: &str) -> Result<PathBuf>
Expand description

Get a directory for per-user Tectonic cache files, creating it if needed.

The path argument may include subdirectories, but the directory separator should be a forward slash on all platforms. It may be an empty string if you want to get the toplevel user cache directory.

This function is currently implemented with app_dirs2::app_dir using the UserCache data type. Return values have the form:

  • Windows: %LOCALAPPDATA%\TectonicProject\Tectonic, where %LOCALAPPDATA% is something like C:\Users\knuth\AppData\Local.
  • macOS: $HOME/Library/Caches/Tectonic
  • Others: $XDG_CACHE_HOME/Tectonic if defined, otherwise $HOME/.cache/Tectonic