Learn R Programming

getlandsat (version 0.2.0)

lsat_cache: Manage cached files

Description

Manage cached files

Usage

lsat_cache_list()

lsat_cache_delete(files, force = TRUE)

lsat_cache_delete_all(force = TRUE)

lsat_cache_details(files = NULL)

Arguments

files

(character) one or more complete file names

force

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

Functions

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

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

  • lsat_cache_delete_all() delete all files, returns nothing

  • lsat_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)

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("landsat-pds")

Examples

Run this code
# NOT RUN {
# list files in cache
lsat_cache_list()

# List info for single files
lsat_cache_details(files = lsat_cache_list()[1])
lsat_cache_details(files = lsat_cache_list()[2])

# List info for all files
lsat_cache_details()

# delete files by name in cache
# lsat_cache_delete(files = lsat_cache_list()[1])

# delete all files in cache
# lsat_cache_delete_all()
# }

Run the code above in your browser using DataLab