本文整理汇总了Python中sickbeard.helpers.hardlinkFile函数的典型用法代码示例。如果您正苦于以下问题:Python hardlinkFile函数的具体用法?Python hardlinkFile怎么用?Python hardlinkFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hardlinkFile函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _int_hard_link
def _int_hard_link(cur_file_path, new_file_path):
self._log(u"Hard linking file from " + cur_file_path + " to " + new_file_path, logger.DEBUG)
try:
helpers.hardlinkFile(cur_file_path, new_file_path)
helpers.chmodAsParent(new_file_path)
except (IOError, OSError), e:
self._log("Unable to link file " + cur_file_path + " to " + new_file_path + ": "+ex(e), logger.ERROR)
raise e
示例2: _int_hard_link
def _int_hard_link(cur_file_path, new_file_path, success_tmpl=u' %s to %s'):
try:
helpers.hardlinkFile(cur_file_path, new_file_path)
helpers.chmodAsParent(new_file_path)
self._log(u'Hard linked file from' + (success_tmpl % (cur_file_path, new_file_path)), logger.DEBUG)
except (IOError, OSError), e:
self._log(u'Unable to link file %s<br />.. %s' % (success_tmpl % (cur_file_path, new_file_path), str(e)), logger.ERROR)
raise e