I don't think your package directory is good place for file caching. It
would be better to put your caches in the system's temporary directory, for
Mac (also check echo $TMPDIR) and Linux that is at "/tmp" for windows it is
at "C:\Users\<username>\AppData\Local\Temp" (check *ECHO %Temp%*)
On Tuesday, December 1, 2015 at 8:18:27 PM UTC+2, Penn Taylor wrote:
>
> I'm working on a package that downloads and caches large datasets. The
> user accesses information in the datasets via the package, but likely has
> no interest in otherwise having direct access to the raw files. In this
> early stage, my package uses Base.download to grab the files, and then
> stores them in Pkg.dir("MyPackageName")/cache. This works great, but I have
> some concerns about the strategy that I'd like input/advice on.
>
> 1. Downloading
> Base.download includes this warning in its documentation: "For production
> use or situations in which more options are needed, please use a package
> that provides the desired functionality instead."
>
> I don't need more options, but the "production use" part leads me to
> believe I shouldn't rely on Base.download inside a package. Is there a
> particular package that most people tend to use for fetching remote uris
> from within another package? Or is Base.download generally "good enough"
> for use in my situation?
>
>
> 2. Caching
> I haven't found information on whether package directories are guaranteed
> to be user-writable, so don't know whether my caching location is likely to
> be problematic. Is Pkg.dir("MyPackageName")/cache generally a good place
> for this kind of file caching, or is there a different location or pattern
> that is preferable for a package?
>
> Thanks,
> Penn Taylor
>