Sets the file extension for a cache record
Arguments
- key
Character: key for a cache item, alternatively a version entry.
- ext
Character: the file extension, e.g. "zip".
Examples
bioc_url <- 'https://bioconductor.org/'
version <- omnipath_cache_latest_or_new(url = bioc_url)
version$path
#> [1] "/home/denes/.cache/OmnipathR/41346a00fb20d2a9df03aa70cf4d50bf88ab154a-1.rds"
# [1] "/home/denes/.cache/OmnipathR/41346a00fb20d2a9df03-1"
httr::GET(bioc_url, httr::write_disk(version$path, overwrite = TRUE))
#> Response [https://bioconductor.org/]
#> Date: 2024-04-07 15:20
#> Status: 200
#> Content-Type: text/html
#> Size: 37.3 kB
#> <ON DISK> /home/denes/.cache/OmnipathR/41346a00fb20d2a9df03aa70cf4d50bf88ab154a-1.rds
key <- omnipath_cache_key(url = bioc_url)
omnipath_cache_set_ext(key = key, ext = 'html')
version <- omnipath_cache_latest_or_new(url = bioc_url)
version$path
#> [1] "/home/denes/.cache/OmnipathR/41346a00fb20d2a9df03aa70cf4d50bf88ab154a-1.html"
# [1] "/home/denes/.cache/OmnipathR/41346a00fb20d2a9df03-1.html"
record <- omnipath_cache_get(url = bioc_url)
record$ext
#> [1] "html"
# [1] "html"
omnipath_cache_remove(url = bioc_url) # cleaning up