How to keep remote file name by bfcadd in BiocFileCache?
1
0
Entering edit mode
Qiang ▴ 80
@qiang-9580
Last seen 4.0 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)
add1 <- bfcadd(bfc0, "bwa", 
               fpath = "https://raw.githubusercontent.com/hubentu/RcwlRecipes/master/Rcwl/tl_bwa.R",
               rpath = file.path(tempdir(), "tl_bwa.R"))
add1
## "/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 • 874 views
ADD COMMENT
0
Entering edit mode
shepherl 4.1k
@lshep
Last seen 3 hours 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.

ADD COMMENT
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!

ADD REPLY
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.

ADD REPLY

Login before adding your answer.

Traffic: 732 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6