def _create_windows(source, destination, link_type):
"""Creates hardlink at destination from source in Windows."""
if link_type == HARDLINK:
import ctypes
from ctypes.wintypes import BOOL
CreateHardLink = ctypes.windll.kernel32.CreateHardLinkW
CreateHardLink.argtypes = [
ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_void_p
]
CreateHardLink.restype = BOOL
res = CreateHardLink(destination, source, None)
if res == 0:
raise ctypes.WinError()
else:
raise NotImplementedError("Link type unrecognized.")
评论列表
文章目录