def make_recovery_copy(self, cache_file):
		path = re.sub(self.cache.cache_path, '', cache_file)
		path = re.sub('/files', '', path)
		recovery_file = self.recovery_path + path

		self.logger.info("PLUGIN copying file from '%s' to '%s'"%(cache_file, recovery_file))

		recovery_path = os.path.dirname(recovery_file)
		try:
			os.makedirs(recovery_path)
			self.logger.debug("PLUGIN created recovery path '%s' done" % recovery_path)
		except OSError as exc: # Python >2.5                                        
			if exc.errno == errno.EEXIST and os.path.isdir(recovery_path):
				self.logger.debug("PLUGIN create_dirs '%s' already there" % recovery_path)
				pass
			else:
				raise

	
		import shutil
		shutil.copyfile(cache_file, recovery_file)

		self.logger.info("PLUGIN copying file from '%s' to '%s' done"%(cache_file, recovery_file))

		return True
dataset/ETHPy150Open danilop/yas3fs/yas3fs/RecoverYas3fsPlugin.py/RecoverYas3fsPlugin.make_recovery_copy/original