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

Proposal: deeper cache searches #21

Open
3 tasks
vreuter opened this issue Sep 6, 2017 · 3 comments
Open
3 tasks

Proposal: deeper cache searches #21

vreuter opened this issue Sep 6, 2017 · 3 comments

Comments

@vreuter
Copy link
Member

vreuter commented Sep 6, 2017

Sometimes I forget the subfolder to which I wrote a cache. Or even if not, I've explored the filesystem and have found the name that I want. Now I want to loadCaches() it. "Uh-oh...I need to successfully reconstruct the path to the folder that cache is inhabiting, relative to my RCACHE.DIR! Wait...what's my RCHACHE.DIR?! Calling getOption...that's just too much to handle."

Anyway, fun hypotheticals aside, it'd be cool to have some parameter like recursive (maybe even defaulting to TRUE) to allow simpleCache to explore the hierarchy rooted at RCACHE.DIR. listCaches() could implement this, and then simpleCache and loadCaches could call into that.

  • add deeper capability to listCaches
  • call into listCaches from loadCaches
  • call into listCaches from simpleCache (though possibly precluded by how loadCaches failure message #20 is handled)
@vreuter
Copy link
Member Author

vreuter commented Sep 6, 2017

Ah, also linked to #15!

@nsheff
Copy link
Member

nsheff commented Sep 6, 2017

wait, why can't you just pass cacheSubDir to loadCaches?

we can't have simpleCache loading caches from other subdirs, since we use subdirs as a kind of namespace to separate caches that may have the same name.

but yes, listCaches should show subdirs (per #15) and it could also display RCACHE.DIR.

@vreuter
Copy link
Member Author

vreuter commented Sep 6, 2017

I could, but that's the "I need to successfully reconstruct the path to the folder that the cache is inhabiting" part. No big deal if the subfolder is within the RCACHE.DIR itself, but if the subfolder is multiple layers deep, it seems tedious to force the user to reconstruct it.

If we make listCaches do something akin to find <value-of-RCACHE-DIR> -name "*.RData", that operation would contain the complete set of cache names available. If just a name's passed, then there would be an error if there's a collision, but if not, then the uniquely-matched cache file would be used (or an error or whatever if there's no match at all).

@vreuter vreuter self-assigned this Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants