Show More
@@ -146,9 +146,18 b' class WinOSError(WinError, OSError):' | |||
|
146 | 146 | self.win_strerror) |
|
147 | 147 | |
|
148 | 148 | def os_link(src, dst): |
|
149 | # NB will only succeed on NTFS | |
|
150 | 149 | try: |
|
151 | 150 | win32file.CreateHardLink(dst, src) |
|
151 | # CreateHardLink sometimes succeeds on mapped drives but | |
|
152 | # following nlinks() returns 1. Check it now and bail out. | |
|
153 | if nlinks(src) < 2: | |
|
154 | try: | |
|
155 | win32file.DeleteFile(dst) | |
|
156 | except: | |
|
157 | pass | |
|
158 | # Fake hardlinking error | |
|
159 | raise WinOSError((18, 'CreateHardLink', 'The system cannot ' | |
|
160 | 'move the file to a different disk drive')) | |
|
152 | 161 | except pywintypes.error, details: |
|
153 | 162 | raise WinOSError(details) |
|
154 | 163 |
General Comments 0
You need to be logged in to leave comments.
Login now