[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Distribute "data files" with a package

From: Daniel Kraft
Subject: Distribute "data files" with a package
Date: Mon, 31 Mar 2014 13:41:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0


I'm currently working on an Octave package, and want to distribute
certain "data files" with it.  (In my particular case, it is an image
file to be used by one of the package's "demo" functions.)

When I include the file in the package's "inst/" directory, it gets
installed correctly to the package installation folder.  However, now
I'm wondering how I can access it from within a demo function.  I tried
without an explicit directory specification, but that fails (since it
looks in the current working directory as opposed to the .m file's

This must be something others have already stumbled upon -- how can one
access such "data files" distributed with a package?  Is there a
function that can be called from within an .m file and that returns the
directory that contains the .m file?

The best I could find so far is "pkg list", and then sifting through the
list of packages looking for my package's name and then using the
installation directory.  But that seems to be too complicated for such a
"seemingly easy" task.  Is there no better way to query for the
installation directory of a particular package, for instance?  Or even
of "this package" from within a package's functions?

Thanks!  Yours,

OpenPGP: 901C 5216 0537 1D2A F071  5A0E 4D94 6EED 04F7 CF52
Namecoin: id/domob ->
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]