1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

Added hardlink/symlink support for Windows Vista+.

Fixes #220.
This commit is contained in:
Virgil Dupras
2013-07-14 11:58:49 -04:00
parent 097b949763
commit 9225697053
22 changed files with 439 additions and 278 deletions

View File

@@ -5,6 +5,8 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import os
from hscommon.gui.base import GUIObject
from hscommon.trans import tr
@@ -22,3 +24,15 @@ class DeletionOptions(GUIObject):
self.view.update_msg(msg)
return self.view.show()
def supports_links(self):
# When on a platform that doesn't implement it, calling os.symlink() (with the wrong number
# of arguments) raises NotImplementedError, which allows us to gracefully check for the
# feature.
try:
os.symlink()
except NotImplementedError:
return False
except TypeError:
# wrong number of arguments
return True