Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to store data files in packages

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103669] Re: How to store data files in packages
  • From: Yves Klett <yves.klett at googlemail.com>
  • Date: Fri, 2 Oct 2009 08:21:45 -0400 (EDT)
  • References: <ha213g$n9i$1@smc.vnet.net>

Hi,

you could store the data in the notebook itself. You can Compress[] any
expression into a string (compression rate naturally depending on the
data, but quite good in my experience), store that string in the target
notebook or package and Uncompress[] during evaluation (if there is
enough memory in case of large data sets).

The compression can be quite slow for large expression, but
uncompressing works quickly.

Regards,
Yves


Karsten W. schrieb:
> Hello,
> 
> my packages uses some data files. Currently, I store them in a
> subdirectory "resources" below the package directory and access the
> data via
> 
> ToFileName[{$UserBaseDirectory, "Applications", myPackage,
> "resources"}, myDataFileName];
> 
> I wonder if this is a portable way. I am afraid it is not, since the
> package may be installed under $BaseDirectory as well. And then there
> is this directory at the same level as "Applications" named
> "ApplicationData"
> 
> What is the recommended way to store my data files?
> 
> Any hint appreciated,
> 
> kind regards,
> Karsten.
> 


  • Prev by Date: Re: DateListPlot & Locator
  • Next by Date: Re: How to store data files in packages
  • Previous by thread: Re: How to store data files in packages
  • Next by thread: Re: How to store data files in packages