Files are created even if the download has not started
- https://github.com/qbittorrent/qBittorrent/issues/21847
qBittorrent & operating system versions
qBittorrent v5.0.1 (64-bit) Qt: 6.7.3 Libtorrent: 1.2.19.0 Boost: 1.86.0 OpenSSL: 3.4.0 zlib: 1.3.1 OS: W10
What is the problem?
Files are created even if the download has not started.
https://github.com/user-attachments/assets/563a4417-525e-4ce2-afe1-37d3ecab4306
https://github.com/user-attachments/assets/3ade2e1b-1238-40ec-8781-6360d5752b12
Steps to reproduce
Start qBittorrent. Add a torrent in a stopped state. Go to the content tab and select/unselect items. Files are created with a size of 0 bytes. This is exacerbated if file preallocation is enabled. MOTW is disabled.
I'll duplicate here:
When you change priority from "do not download" to something else, libtorrent tries to move existing data from
.partsfile to the actual file. But it does not know in advance if there is any data, so creates/allocates the file anyway.
https://github.com/arvidn/libtorrent/blob/1b5ab9f0080050eb99f5a8a0af48087ad98c33c6/src/mmap_storage.cpp#L176-L179