% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sweep_temp_cache.R
\name{sweep_temp_cache}
\alias{sweep_temp_cache}
\title{Temp-Cache Janitor}
\usage{
sweep_temp_cache()
}
\value{
Invisibly returns a named list with components: \code{status} ("done",
"clean", or "cancelled"), \code{dirs_found} (integer), and
\code{space_freed_mb} (numeric).
}
\description{
Scans hidden R temporary directories for abandoned session data and caches, 
categorizes the storage waste, and interactively prompts the user for 
safe deletion to reclaim disk space.
}
\details{
The function performs a deep scan of the OS-level temporary directory 
where R stores session data:
\enumerate{
  \item Identifies all directories matching the `RtmpXXXXXX` pattern.
  \item Scans these directories and categorizes files into buckets:
      \itemize{
        \item \strong{Knitr/RMarkdown Caches}: `.knit.md`, `.utf8.md`, and `_cache` files.
        \item \strong{Downloaded Packages}: `.tar.gz`, `.zip`, and `.tgz` files.
        \item \strong{Raster/Image Files}: `.tif`, `.png`, `.jpg`, and `.grd` files.
        \item \strong{General Session Data}: All other temporary files.
      }
  \item Calculates the total size of each bucket in megabytes.
  \item Interactively prompts the user to select which buckets to permanently flush.
}
}
\section{Warning}{

This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
}

\examples{
if (interactive()) {
  sweep_temp_cache()
}
}
