]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Use FILE_SHARE_WRITE and FILE_SHARE_DELETE when opening files on Windows 1806/head
authorVladimir Kikhtenko <kikht@yandex-team.ru>
Fri, 18 Nov 2022 06:46:18 +0000 (12:46 +0600)
committerVladimir Kikhtenko <kikht@yandex-team.ru>
Fri, 18 Nov 2022 06:54:14 +0000 (12:54 +0600)
commit82353fbe538c991492e9145ca54b2d361aacbe06
tree88652b762c68cb70e3f057f18b111ed18104d43e
parentfa4b613f2e2510bd036f2eeed2fece97cd18b079
Use FILE_SHARE_WRITE and FILE_SHARE_DELETE when opening files on Windows

Many standard libraries(
[libc++](https://github.com/llvm/llvm-project/blob/main/libcxx/src/filesystem/posix_compat.h#L159),
[go](https://cs.opensource.google/go/go/+/refs/tags/go1.19.3:src/syscall/syscall_windows.go;l=331),
[rust](https://doc.rust-lang.org/src/std/os/windows/fs.rs.html#126-131)
) open files on windows with `FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE`
mode by default. Libarchive uses only `FILE_SHARE_READ`, so when file is
being opened by any program that uses these standard libraries
libarchive fails to open it. Here we change libarchive shared flags, so
it plays well with common practice in other programs.
libarchive/archive_read_disk_windows.c