def __init__(self, fileOrPath):
		self._resources = OrderedDict()
		if hasattr(fileOrPath, 'read'):
			self.file = fileOrPath
		else:
			try:
				# try reading from the resource fork (only works on OS X)
				self.file = self.openResourceFork(fileOrPath)
				self._readFile()
				return
			except (ResourceError, IOError):
				# if it fails, use the data fork
				self.file = self.openDataFork(fileOrPath)
		self._readFile()