code: def openDatFile(datpath):
      '''
      Open a file-like object using a pkg relative path.
  
      Example:
  
          fd = openDatFile('foopkg.barpkg/wootwoot.bin')
      '''
      pkgname, filename = datpath.split('/', 1)
  
      pkgmod = s_dyndeps.getDynMod(pkgname)
  
      # are we a regular file?
      pkgfile = os.path.abspath(pkgmod.__file__)
      if os.path.isfile(pkgfile):
          dirname = os.path.dirname(pkgfile)
          datname = os.path.join(dirname, filename)
          return open(datname, 'rb'f openDatFile(datpath):
      '''
      Open a file-like object using a pkg relative path.
  
      Example:
  
          fd = openDatFile('foopkg.barpkg/wootwoot.bin')
      '''
      pkgname, filename = datpath.split('/', 1)
  
      pkgmod = s_dyndeps.getDynMod(pkgname)
  
      # are we a regular file?
      pkgfile = os.path.abspath(pkgmod.__file__)
      if os.path.isfile(pkgfile):
          dirname = os.path.dirname(pkgfile)
          datname = os.path.join(dirname, filename)
          return open(datname, 'rb')
docs: Open a file-like object using a pkg relative path.
  
      Example:
  
          fd = openDatFile('foopkg.barpkg/wootwoot.bin')