rstudio / pins-r

Pin, discover, and share resources
https://pins.rstudio.com
Other
312 stars 63 forks source link

Should pin_download.board_local make a copy? #475

Closed hadley closed 3 years ago

hadley commented 3 years ago

Currently pin_download() returns a path directly to the stored data, so it could potentially be modified:

library(pins)

board <- board_folder("~/desktop/pins")
board %>% pin_write(mtcars, "mtcars")
#> Guessing `type = 'rds'`
#> Creating new version '2f642ce498ec2413'
board %>% pin_download("mtcars")
#> [1] "~/desktop/pins/mtcars/2f642ce498ec2413/mtcars.rds"

Created on 2021-08-04 by the reprex package (v2.0.0)

@jcheng5 do you have any sense of whether or not this is a good idea?

hadley commented 3 years ago

Probably too expensive; maybe try Sys.chmod(path, "0444"). Not sure if that's ok cross-platform. Initial experiments suggest that it's ok, but should confirm with some tests.

github-actions[bot] commented 2 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.