Skip to main content

Module clean

Module clean 

Source
Expand description

Code to remove obsolete and extraneous files from a filesystem-based state directory.

Re-exportsΒ§

use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use tor_basic_utils::PathExt as _; πŸ”’
use tor_error::warn_report; πŸ”’
use tracing::warn; πŸ”’
use web_time_compat::Duration; πŸ”’
use web_time_compat::SystemTime; πŸ”’

ConstantsΒ§

CUTOFF πŸ”’
How old must an obsolete-looking file be before we’re willing to remove it?

FunctionsΒ§

files_to_delete πŸ”’
Implementation helper for FsStateMgr::clean(): list all files in statepath that are ready to delete as of now.
fname_looks_obsolete πŸ”’
Return true if path looks like a filename we’d like to remove from our state directory.
very_old πŸ”’
Return true if entry is very old relative to now and therefore safe to delete.