{-# LANGUAGE CPP #-}{- | Module : System.Win32.HardLink Copyright : 2013 shelarcy License : BSD-style Maintainer : shelarcy@gmail.com Stability : Provisional Portability : Non-portable (Win32 API) Handling hard link using Win32 API. [NTFS only] Note: You should worry about file system type when use this module's function in your application: * NTFS only supprts this functionality. * ReFS doesn't support hard link currently. -}moduleSystem.Win32.WindowsString.HardLink(createHardLink,createHardLink')whereimportSystem.Win32.HardLink.InternalimportSystem.Win32.WindowsString.File(failIfFalseWithRetry_)importSystem.Win32.WindowsString.String(withTString)importSystem.Win32.WindowsString.Types(nullPtr)importSystem.OsPath.Windows #include "windows_cconv.h" -- | NOTE: createHardLink is /flipped arguments/ to provide compatibility for Unix. -- -- If you want to create hard link by Windows way, use 'createHardLink'' instead. createHardLink::WindowsPath-- ^ Target file path ->WindowsPath-- ^ Hard link name ->IO()createHardLink=flipcreateHardLink'createHardLink'::WindowsPath-- ^ Hard link name ->WindowsPath-- ^ Target file path ->IO()createHardLink'linktarget=withTStringtarget$\c_target->withTStringlink$\c_link->failIfFalseWithRetry_(unwords["CreateHardLinkW",showlink,showtarget])$c_CreateHardLinkc_linkc_targetnullPtr