Skip to contents

Counts the files in each subfolder of the cache folder returned by cacs_cache_dir() and reports their total size and their oldest and newest modification times. The folder is not created if it does not exist. For a folder given in the cache_dir argument of another function, first set the option to it, as in options(catchmentACS.cache_dir = "path/to/folder").

Usage

cacs_cache_status()

Value

A tibble with one row for each subfolder (isochrone, acs, acs_test, and intersect; see cacs_clear_cache()) and these columns:

namespace

The subfolder.

n_entries

The number of saved results (.rds files).

orphan_tmp

The number of temporary .rds.tmp files, which are left when a write is interrupted and are never read.

n_fingerprints

The number of checksum files (.fingerprint files; see cacs_cache_dir()).

orphan_fingerprint_tmp

The number of temporary .fingerprint.tmp files, left in the same way.

legacy_entries

The number of .rds files without a checksum file, such as those saved by versions of the package before 0.3.0. Such a file is deleted, and the result computed again, when a later call looks for it.

total_size_mb

The total size of these files and of the GeoPackage files written by cacs_acs_prefetch(write_gpkg = TRUE), in megabytes (1024^2 bytes).

oldest, newest

The earliest and latest modification times of the same files, or NA when there are none. Reading a saved result updates its modification time.

Other files are not counted.

See also

Examples

cacs_cache_status()
#> # A tibble: 4 × 9
#>   namespace n_entries orphan_tmp n_fingerprints orphan_fingerprint_tmp
#>   <chr>         <int>      <int>          <int>                  <int>
#> 1 isochrone         0          0              0                      0
#> 2 acs               0          0              0                      0
#> 3 acs_test          0          0              0                      0
#> 4 intersect         0          0              0                      0
#> # ℹ 4 more variables: legacy_entries <int>, total_size_mb <dbl>, oldest <dttm>,
#> #   newest <dttm>