For the download step, just run `curl -O $url` or something similar. The
`download` function in Base tries to use some API call on Windows, but
since the Julia distribution includes Curl anyway you can just use that
safely on all platforms.

On Wed, 2 Dec 2015 at 09:48 Milan Bouchet-Valat <[email protected]> wrote:

> Le mercredi 02 décembre 2015 à 00:47 -0800, Mohammed El-Beltagy a écrit
>  :
> > 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%)
> I don't know for Windows, but for Linux /tmp is usually cleaned on
> reboot or even every few hours. A possible place would be
> $XDG_CACHE_HOME/$YOUR_PACKAGE, with ~/.cache/$YOUR_PACKAGE as a
> default.
>
> But storing data inside the Julia package dir sounds like a logical
> solution. Maybe we could have an explicit policy about this, and
> standardize on a subdirectory name ? Please file an issue on GitHub to
> discuss this unless some developers chime in.
>
>
> Regards
>
>
> > 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
> > >
>

Reply via email to