Skip to contents

Work with the cache directory

Usage

cache_dir()

cache_info(cache_dir = rappdirs::user_cache_dir("tiltWorkflows"))

cache_delete(
  cache_dir = rappdirs::user_cache_dir("tiltWorkflows"),
  quiet = FALSE
)

Arguments

cache_dir

Character. A directory.

quiet

Logical. Throw a warning?

Value

  • cache_dir() returns a path to the default cache directory.

  • cache_info() returns a data frame with information about the cache directory.

  • cache_delete() deletes the cache directory.

Examples

cache_dir()
#> [1] "~/.cache/tiltWorkflows"

tmp <- tempfile()
dir.create(tmp)

cache_info(tmp)
#> # A tibble: 0 × 18
#> # ℹ 18 variables: modification_time <dttm>, path <fs::path>, type <fct>,
#> #   size <fs::bytes>, permissions <fs::perms>, user <chr>, group <chr>,
#> #   device_id <dbl>, hard_links <dbl>, special_device_id <dbl>, inode <dbl>,
#> #   block_size <dbl>, blocks <dbl>, flags <int>, generation <dbl>,
#> #   access_time <dttm>, change_time <dttm>, birth_time <dttm>

dir.exists(tmp)
#> [1] TRUE

cache_delete(tmp)
#> Warning: Deleting `cache_dir`: 
#>  /tmp/RtmpdcPDiI/file1705594d7f63

dir.exists(tmp)
#> [1] FALSE