title: Using directories for py2app resources
body: <p>I have some data files that are directory-sensitive. How do I add them to my .app bundle?</p>
  
  <p>None of the documentation given by py2app says how to specifically do this. However, after looking around the Internet, I found that one can use tuples to add resources in a specific directory structure. I'm assuming the order is <code>(directoryInResourceFolder, pathToFile)</code>.</p>
  
  <p>When I tried that, I get the following error:</p>
  
  <pre><code>error: No such file or directory: m
  </code></pre>
  
  <p>I don't know why it would be saying that, because none of my tuples are just <code>m</code>. Here is the list of tuples that I generated:</p>
  
  <pre><code>[('src/math_patterns', 'math_patterns/_BordersSlashes.txt'), ('src/math_patterns', 'math_patterns/_codes.txt'), ('src/math_patterns', 'math_patterns/_Dollars.txt'), ('src/math_patterns', 'math_patterns/_Fences.txt'), ('src/math_patterns', 'math_patterns/_Final.txt'), ('src/math_patterns', 'math_patterns/_Fractions.txt'), ('src/math_patterns', 'math_patterns/_FunctionsLimits.txt'), ('src/math_patterns', 'math_patterns/_Integrals.txt'), ('src/math_patterns', 'math_patterns/_Numbers.txt'), ('src/math_patterns', 'math_patterns/_PowersPrimes.txt'), ('src/math_patterns', 'math_patterns/_SoftFractions.txt'), ('src/math_patterns', 'math_patterns/_test.txt'), ('src/math_patterns', 'math_patterns/_Trig.txt'), ('src/math_patterns', 'math_patterns/_Unicodes.txt'), ('src/math_patterns', 'math_patterns/_Vocab.txt'), ('src/math_patterns', 'math_patterns/Calculus.txt'), ('src/math_patterns', 'math_patterns/General.txt'), ('src/math_patterns', 'math_patterns/Geometry and Trigonometry.txt'), ('src/math_patterns', 'math_patterns/Linear Algebra.txt'), ('src/math_patterns', 'math_patterns/Logic.txt'), ('src/math_patterns', 'math_patterns/Statistics.txt')]
  </code></pre>
  
  <p>Here is the setup.py I'm using:</p>
  
  <pre><code>from setuptools import setup
  import os
  
  APP = ['main.py']
  
  # Prepare all of the resources that I would need
  RESOURCES = []
  
  p = 'math_patterns'
  files = []
  for f in os.listdir(p):
      fullPath = os.path.join(p, f)
      if os.path.isfile(fullPath):
          files.append(('src/math_patterns', fullPath))
  RESOURCES.extend(files)
  
  PACKAGES = ['lxml']
  
  INCLUDES = ['sip']
  
  OPTIONS = {'argv_emulation': True,
             'packages': PACKAGES,
             'includes': INCLUDES,
             'resources': RESOURCES}
  
  setup(
      app=APP,
      options={'py2app': OPTIONS},
      setup_requires=['py2app', 'lxml', 'PIL'],
  )
  </code></pre>
  
  <p>Thanks for your time in looking at this!</p>
  
  <p>--
  EDIT</p>
  
  <p>Using absolute paths made that particular error go away. But now it's trying to create an <code>.apdisk</code> in the <code>math_patterns</code> directory, which spits out the following error:</p>
  
  <pre><code>error:/.DocumentRevisions-V100: Permission denied
  </code></pre>