How to keep remote file name by bfcadd in BiocFileCache?
1
0
Entering edit mode
Qiang ▴ 70
@qiang-9580
Last seen 2.3 years ago

Hi,

Is there an option to keep the original file name when adding a 'web' file by bfcadd? For example,

bfc0 <- BiocFileCache(tempdir(), ask = F)
fpath = "https://raw.githubusercontent.com/hubentu/RcwlRecipes/master/Rcwl/tl_bwa.R",
rpath = file.path(tempdir(), "tl_bwa.R"))
## "/tmp/RtmpzSEpeG/b01175a39e7e_tl_bwa.R"


A prefix was added to the file name. Is it possible to keep the original name?

Thanks, Qiang

BiocFileCache • 395 views
0
Entering edit mode
shepherl 3.4k
@lshep
Last seen 1 hour ago
United States

No it is currently not possible. We add a prefix to the local file so that there could be multiple versions of the same file stored in the cache. The fpath stores the original url that has all the original information. You could also update the rname to hold this information if it is needed.

0
Entering edit mode

I see. I guess I have to download the remote file first and then add it to the cache locally. Thanks!

0
Entering edit mode

Why is that? If the file management is handled with BiocFileCache would there be a need to directly access the file by that specific name? BiocFileCache should be able to handle the download and caching, and then if you utilize the interface give you the location of the local file path to use in coding.