Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show files #93

Merged
merged 9 commits into from
Jan 28, 2021
Merged

Show files #93

merged 9 commits into from
Jan 28, 2021

Conversation

ateucher
Copy link
Collaborator

Adds more information to show_cached_files() so a user can know how much space they are taking up. #92

@ateucher ateucher requested a review from boshek January 26, 2021 01:31
@boshek
Copy link
Collaborator

boshek commented Jan 26, 2021

Looks great. Did we want to go through the trouble of compute the size of subfolders? Right now it just the cded but in the output of show_cached_files the CDED directory has a size zero.

@ateucher
Copy link
Collaborator Author

I wondered about that too... or an argument (or other function) to show the cded cache?

@boshek
Copy link
Collaborator

boshek commented Jan 26, 2021

Feels like it belong in the show files function somehow especially since it is likely to be by far the biggest thing taking up space. I guess you could have show_cded_cached_files and then have show_cached_files call that?

@ateucher
Copy link
Collaborator Author

I guess just expanding the cded folder would be the simplest... with a cded (logical) argument whether or not you want to show it?

@boshek
Copy link
Collaborator

boshek commented Jan 27, 2021

I think that might end up being less useful as 95% of the files are cded files. I wonder if we could summarise it by the directors or files at this location: bcmaps:::data_dir()? So in this case cded is just the sum of file sizes of a recursive list of what is in cded.

@ateucher
Copy link
Collaborator Author

Yeah that's good

@ateucher
Copy link
Collaborator Author

Ok, I think this works now. Lists the cded dir (or any dir, but right now that should be the only one) with the sum of the files. I also modified delete_cache() so that the cded dir is also deleted (when specified or when files_to_delete = NULL).

library(bcmaps)
#> Loading required package: sf
#> Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.1

show_cached_files()
#> # A tibble: 2 x 4
#>   file                                        is_dir size_MB modified           
#>   <chr>                                       <lgl>    <dbl> <dttm>             
#> 1 /Users/ateucher/Library/Caches/org.R-proje… FALSE   0.0191 2021-01-28 10:21:30
#> 2 /Users/ateucher/Library/Caches/org.R-proje… TRUE    8.66   2021-01-28 10:21:31

Created on 2021-01-28 by the reprex package (v0.3.0)

@ateucher ateucher merged commit b77ce28 into master Jan 28, 2021
@ateucher ateucher deleted the show-files branch January 28, 2021 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants