mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-09 18:51:56 -04:00
Clean up previous PR
This commit is contained in:
parent
892ed90533
commit
48147ebd52
@ -104,9 +104,8 @@ 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
|
||||
# Do not open symbolic link target to prevent unwanted delete_on_close
|
||||
flags |= getattr(winutil, 'FILE_FLAG_OPEN_REPARSE_POINT', 0x00200000)
|
||||
access_flags = winutil.GENERIC_READ
|
||||
if self.delete_all:
|
||||
access_flags |= winutil.DELETE
|
||||
|
||||
@ -1553,6 +1553,7 @@ exec_module(PyObject *m) {
|
||||
A(FILE_ACTION_RENAMED_NEW_NAME);
|
||||
A(FILE_LIST_DIRECTORY);
|
||||
A(FILE_FLAG_BACKUP_SEMANTICS);
|
||||
A(FILE_FLAG_OPEN_REPARSE_POINT);
|
||||
A(SHGFP_TYPE_CURRENT);
|
||||
A(SHGFP_TYPE_DEFAULT);
|
||||
A(PIPE_ACCESS_INBOUND);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user