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

API to get the cached path for a blob #59

Open
mbauman opened this issue Nov 28, 2022 · 1 comment
Open

API to get the cached path for a blob #59

mbauman opened this issue Nov 28, 2022 · 1 comment

Comments

@mbauman
Copy link
Member

mbauman commented Nov 28, 2022

All the ways to work with a Blob (er, I suppose after 0.2.7 it's just File) are IO-based. But it's backed by a file that's cached in tmp. Not all packages work with IO-based methods and instead want a direct path to a file. How can I get that file? It reports to Julia that it isfile and will happily return its abspath... but it's not really either!

@mortenpi
Copy link
Member

But it's backed by a file that's cached in tmp.

Generally speaking, I don't think that is necessarily always true. E.g. for Blobs/Files that are stored within TOML files; or for large remote files that could implement some paged caching (i.e. only downloading some chunks of the file to the local machine).

As such, I think the current official recommended way should be to just copy the data to your own temporary file. E.g. write("my-temp-file", open(IO, dataset)) should work.

That said, maybe we should nevertheless have an API that gives you a path to a local cached file if it is available, and copies the full contents into a new temporary file if it isn't.

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

No branches or pull requests

2 participants