cc_cache: Manage cached CCAFS files

cc_cacheR Documentation

Manage cached CCAFS files

Description

Manage cached CCAFS files

Usage

cc_cache_list()

cc_cache_delete(files, force = TRUE)

cc_cache_delete_all(force = TRUE)

cc_cache_details(files = NULL)

Arguments

files

(character) one or more complete file names

force

(logical) Should files be force deleted? Default: TRUE

Details

cache_delete only accepts 1 file name, while cache_delete_all doesn't accept any names, but deletes all files. For deleting many specific files, use cache_delete in a lapply() type call

We cache using rappdirs::user_cache_dir(), find your cache folder by executing rappdirs::user_cache_dir("ccafs")

Functions

  • cc_cache_list() returns a character vector of full path file names

  • cc_cache_delete() deletes one or more files, returns nothing

  • cc_cache_delete_all() delete all files, returns nothing

  • cc_cache_details() prints file name and file size for each file, supply with one or more files, or no files (and get details for all available)

Examples

## Not run: 
# list files in cache
cc_cache_list()

# List info for single files
cc_cache_details(files = cc_cache_list()[1])
cc_cache_details(files = cc_cache_list()[2])

# List info for all files
cc_cache_details()

# delete files by name in cache
# cc_cache_delete(files = cc_cache_list()[1])

# delete all files in cache
# cc_cache_delete_all()

## End(Not run)

ropensci/ccafs documentation built on May 18, 2022, 9:49 a.m.