mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-09-29 15:31:08 -04:00
Merge branch 'fix-symlinks-windows' of https://github.com/allexendar/calibre
This commit is contained in:
commit
892ed90533
@ -104,6 +104,9 @@ class WindowsFileCopier:
|
||||
|
||||
def _open_file(self, path: str, retry_on_sharing_violation: bool = True, is_folder: bool = False) -> 'winutil.Handle':
|
||||
flags = winutil.FILE_FLAG_BACKUP_SEMANTICS if is_folder else winutil.FILE_FLAG_SEQUENTIAL_SCAN
|
||||
if os.path.islink(path):
|
||||
# Do not open symbolic link target to prevent unwanted delete_on_close
|
||||
flags |= 0x00200000 # winutil.FILE_FLAG_OPEN_REPARSE_POINT
|
||||
access_flags = winutil.GENERIC_READ
|
||||
if self.delete_all:
|
||||
access_flags |= winutil.DELETE
|
||||
|
Loading…
x
Reference in New Issue
Block a user