mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Rename file will overwrite existing file with same name which is not part of torrent #14173
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#14173
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 @ted423 on GitHub (Dec 31, 2022).
qBittorrent & operating system versions
qBittorrent: 4.5.0 x64
Operating system: Ubuntu 22.04.1 LTS
Qt: 5.15.3
libtorrent-rasterbar: 2.0.8.0
What is the problem?
rename the filename in content.
two torrent


Steps to reproduce
I have all first pic's file and want recheck the secound pic's torrent
false to rename "Cars.2.2011.Hybrid.1080p.BluRay.x264-EbP.mkv" to "Cars Toon Air Mater 1080p BluRay x264-EbP.mkv"
than rename the "Cars Toon Air Mater 1080p BluRay x264-EbP.mkv" back to "Cars 2 2011 Hybrid 1080p BluRay x264-EbP.mkv"
the 7.79GiB file disapeared
Additional context
No response
Log(s) & preferences file(s)
No response
@ted423 commented on GitHub (Dec 31, 2022):
rename the "Cars Toon Air Mater 1080p BluRay x264-EbP.mkv" back to "Cars 2 2011 Hybrid 1080p BluRay x264-EbP.mkv"
make the 432.2Mib file overwrite the "Cars 2 2011 Hybrid 1080p BluRay x264-EbP.mkv"(7.79GiB) though the file can't hash in secound torrent
@thalieht commented on GitHub (Dec 31, 2022):
First of all please wrap filenames in ` ` or " " because it's hard to distinguish where they start/end among plain text.
What i understood is that you renamed a file to the same name of an existing file in that folder right? I get "Failed to update name" when i try to do that.
@ted423 commented on GitHub (Jan 1, 2023):
added ".
for torrent 2, is not hashed. the first wrong step make the filename same as the exist small one. and step 2 make the small file to overwrite other one.
I had meet this situation before,maybe i make a screen record when I had time
@ted423 commented on GitHub (Jan 5, 2023):
I found same on GUI
@ted423 commented on GitHub (Jan 5, 2023):
2023-01-05 17-18-57.zip
@stalkerok commented on GitHub (Aug 7, 2025):
Unzip (for convenience)
https://github.com/user-attachments/assets/88390fab-670e-4a61-ae59-d21d5f67c592
@glassez commented on GitHub (Aug 7, 2025):
I can't imagine why
libtorrentbehaves this way. Maybe we can convince they that "fail if exists" strategy is more appropriate for renaming files? Unfortunatelylibtorrentdoesn't provide us with corresponding option (unlike "move storage" case).(Of course we could work around it at qBittorrent level.)
@ted423 commented on GitHub (Aug 7, 2025):
I'm not sure if this is the right way to handle it, because we're dealing with a file that has 0% verification. I'm uncertain whether we should ask the user to skip the actual disk file operations, My situation was caused by a mistake, and while I understand this might be a rare case, the subsequent risk of overwriting files is dangerous.
Alternatively, we could just throw an error directly if the file already exists, letting the user handle it by re-adding the torrent or finding another solution. I'm also worried that a user might accidentally paste a path and overwrite an important file.
@Dnkhatri commented on GitHub (Aug 8, 2025):
If we add a torrent and a file with the same name exists qbittorrent tries to check against the file if it is different overwrites it. This essentially something similar so if the filename check is added wont it break this in qbittorrent
@glassez commented on GitHub (Aug 10, 2025):
https://github.com/arvidn/libtorrent/issues/8008
@ted423 commented on GitHub (Aug 11, 2025):
I don't think they are quite the same, because the phenomenon you mentioned is that a file has the same name as an existing file in the torrent. Typically, users need to be aware that files with the same name can actually be different. And the software also performs a check first; it doesn't overwrite directly.
On the other hand, the phenomenon I'm talking about is when the software uses a file that completely fails validation to directly overwrite a correct, existing file.
Of course, I imagine that a file that passes validation could also overwrite any other file in the same folder without warning. This could also be a problem. But personally, I would categorize that more as a user operation issue.
Also, I think glassez's opinion is to return failed directly instead of asking the user, and I feel that is probably better.
@glassez commented on GitHub (Aug 12, 2025):
Above, I only talked about the case of renaming files of an already added torrent. I believe that in the vast majority of cases it would be used specifically for renaming files. Another possible use case is to "map an existing file" - it's not currently supported anyway (at least without additional user actions).
As for the case of renaming files when adding a torrent, it is much more complicated, since "mapping an existing file" is one of its regular uses so we can't just "fail on exists" unconditionally. I'm currently considering ways to solve this problem.