mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Files are created even if the download has not started #16360
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#16360
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stalkerok on GitHub (Nov 15, 2024).
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.
Additional context
No response
Log(s) & preferences file(s)
n/a
@HanabishiRecca commented on GitHub (Nov 15, 2024):
This is a libtorrent issue for sure. Check if 2.0 has the same behavior.
@stalkerok commented on GitHub (Nov 15, 2024):
The behavior is the same.
@unregd commented on GitHub (Dec 2, 2024):
5.0.2
Win10pro
Qt: 6.7.3
Libtorrent: 1.2.19.0
Boost: 1.86.0
OpenSSL: 3.4.0
zlib: 1.3.1
"Do not start the download automatically" is turned on.
When a torrent containing 0 length files is added these dirs\files are created immediately without touching anything.
Preallocation on or off makes no difference.
@HanabishiRecca commented on GitHub (Dec 2, 2024):
This one is intentional.
@unregd commented on GitHub (Dec 2, 2024):
Unfortunate, it leaves unwanted trash around. :/
@stalkerok commented on GitHub (Dec 2, 2024):
What does that mean? If you delete the torrent along with the data, this file is also deleted.
(can't find a related issue)
@unregd commented on GitHub (Dec 2, 2024):
The automatically added torrents, in stopped state, create files before they are decided to be downloaded or deleted (from the queue). I don't expect files to be created without actually starting the download.
@stalkerok commented on GitHub (Dec 2, 2024):
In any case, that's irrelevant to this issue.
@unregd commented on GitHub (Dec 2, 2024):
I can see it now. The description fits, only the reproduction steps tell the difference.
@stalkerok commented on GitHub (Dec 13, 2024):
@thalieht please add the libtorrent label.
@superbonaci commented on GitHub (Jul 9, 2025):
This is also related to : https://github.com/qbittorrent/qBittorrent/issues/19398
The option
Pre-allocatebehaves differently depending on operating system and filesystem involved, and also depends on each filesystem capabilities, like sparse files, compression, deduplication, so on...@HanabishiRecca commented on GitHub (Sep 2, 2025):
This can not be fixed on qBittorrent side.
@HanabishiRecca commented on GitHub (Sep 2, 2025):
Because qBittorrent doesn't do anything on its own here, it only sets native libtorrent file priorities. All I/O operations with files content and allocation are performed by libtorrent.
Report the problem to libtorrent.
I guess noone cared enough to do that. At least no mentions could be seen in this issue.
Good luck with that though, especially if you want the possible fix to be backported to 1.2.
@martingalvan commented on GitHub (Sep 2, 2025):
Will do, thanks.
@HanabishiRecca commented on GitHub (Sep 2, 2025):
Well, quick analyze of libtorrent's code reveals why this happens.
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.This is a very important function and I'm not sure if its behavior could be changed easily, if at all.
@HanabishiRecca commented on GitHub (Sep 2, 2025):
One easy fix I see is to move the
open_filecall inside theif (m_part_file && use_partfile(i))condition. It should prevent files from creating when none of their parts are present in the.partsfile.But beside that, if some parts of the file are already present in
.parts, I think nothing could be done here.@HanabishiRecca commented on GitHub (Sep 2, 2025):
I tested it and that doesn't work though. Apparently, all files are set to use the partfile initially. So I don't see solutions for the problem, it inherently comes from how the partfile works.
But you still could report it. Maybe Arvid or someone else would come up with something. You could also link my messages.
@stalkerok commented on GitHub (Sep 2, 2025):
As far as I remember, there was a issue, but I can't find it. Perhaps I'm confusing it with something else, otherwise I would have related them.
@l-n0-0b commented on GitHub (Sep 3, 2025):
it's good that it's as shown in the video.
This solves just my problem https://github.com/qbittorrent/qBittorrent/issues/23188
@l-n0-0b commented on GitHub (Sep 3, 2025):
Sorry to interrupt. But I have a suggestion to create a 3 boot state as "pause", which will solve many problems.
Including this one, files will not be created in the "stop" state, they will be created "pause" state.
This will also be able to solve my other problems - including task freezes (which freezes the entire application) - work with 5 files will be paused (task freezes), and with 1 task continue to work. Etc. Thank you.