mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 02:53:06 +02:00
Compare filesizes to verify the hardlinking worked on windows, more robust
This commit is contained in:
parent
7a174b5bc8
commit
88620ed588
1 changed files with 2 additions and 2 deletions
|
|
@ -307,7 +307,7 @@ def copy_path_to(self, path, dest):
|
|||
' operation was started'%path)
|
||||
try:
|
||||
win32file.CreateHardLink(dest, path)
|
||||
if not os.path.exists(dest):
|
||||
if os.path.getsize(dest) != os.path.getsize(path):
|
||||
raise Exception('This apparently can happen on network shares. Sigh.')
|
||||
return
|
||||
except:
|
||||
|
|
@ -348,7 +348,7 @@ def hardlink_file(src, dest):
|
|||
if iswindows:
|
||||
import win32file
|
||||
win32file.CreateHardLink(dest, src)
|
||||
if not os.path.exists(dest):
|
||||
if os.path.getsize(dest) != os.path.getsize(src):
|
||||
raise Exception('This apparently can happen on network shares. Sigh.')
|
||||
return
|
||||
os.link(src, dest)
|
||||
|
|
|
|||
Loading…
Reference in a new issue