title: Julia package data files and absolute/relative paths
body: <p>I'm creating a package in Julia and have followed the <a href="http://docs.julialang.org/en/release-0.4/manual/packages/#package-development" rel="nofollow">Package Development</a> section of the Docs.</p>
  
  <p>One of my functions opens and reads in a data file (<code>mydata.txt</code>) that I'm storing in the package directory.</p>
  
  <p>Everything works pretty great when I run the Julia from the package directory but not so great when I run the tests or run Julia from a different directory because it doesn't know where to find that data file.</p>
  
  <p>I thought I could just do something like:</p>
  
  <pre><code>datapath = Pkg.dir("MyPkg") * "/data/"
  </code></pre>
  
  <p>to get an absolute path to the file but it still doesn't seem to work.</p>
  
  <p>What is the correct way to provide an absolute file path for data in a package?</p>