mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Opening/Set Location on a torrent with long paths (260+ characters) fails #12679
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#12679
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 @Zerowalker on GitHub (Dec 22, 2021).
qBittorrent & operating system versions
qBittorrent: 4.3.9 x64
Operating system: Windows 10 Pro 21H1 x64 10.0.19043
Qt: 5.15.2
libtorrent-rasterbar: 1.2.14
What is the problem?
Opening a file that has too long of a path (260+ characters) doesn't seem to work, while opening it manually inside the folder does (assumes it depends if the application opening actually supports long paths though).
Using "set location" to move a torrent where the paths are too long will fail, saying permissions is denied.
But downloading the torrent and creating those long paths works just fine, so it seems that some parts in qbittorrent doesn't properly handle long paths?
Steps to reproduce
2.1 Try using "set location" to move the torrent anywhere besides it's original location and it will fail with "permission denied".
Additional context
I sadly don't have the logs where it failed left, but in my case i found a workaround to moving the torrent which i might as well write here.
Create a junction to the torrent folder so that the path ends up being less than 260 characters.
Example:
Original: D:....\foo\bar.......\MyTorrent
Junction: D:\MyTorrent
(Junction is like a symlink, it points to a specific folder like a shortcut, but it acts just like the original folder,
but the path will be altered, so it's a trick to shorten paths).
Alternatively you might be able to use 8.3 paths, though they are usually disabled i think, but one can manually generate them i believe, but i think this is a bit messier than the junction method.
Now in qBittorrent you use "set location" and tell it to change to "D:\MyTorrent", it will then recheck the data there first before attempting to move i think, cause after it rechecks and sees that it's 100% valid, it will just assume that it has been moved (even though it didn't move anything?).
The files/folders are now in a shorter paths and you can just use "set location" again to move it to wherever you want (except if the destination ends up with long path names i guess, haven't tested that yet).
Log(s) & preferences file(s)
No response
@Zerowalker commented on GitHub (Dec 22, 2021):
Oh right, if it matters i got "Enable Long Paths" enabled, but i am actually not sure what it even does,
as it clearly doesn't just solve it, cause Explorer itself can't handle long paths anyway.
https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later
EDIT:
Though according to the documentation it looks like the basic WinAPI functions for handling files/folders won't have any restrictions if this is enabled, so i am quite interested how qBittorrent handles this as it seems it doesn't help.
I am guessing it either utilizes explorer (which doesn't support it?), or it has the limit hardcoded?
@xavier2k6 commented on GitHub (Jul 23, 2025):
This ticket has been closed.
Closure Reason: being "out-of-date", and thus either most likely resolved in recent versions or no longer applicable.
If you experience the reported problem or similar in the latest version, please open a new issue report with the requested information in the issue template.
Due to the changes made to the qBittorrent code and its dependencies over time, the exact cause of your problem could be totally different than the original one, despite the visible symptoms of the bug being similar.
Thus, providing relevant updated information is crucial to find and fix the root cause of a recurrent problem or regression.
A new issue report with relevant updated data gathered from the latest version is preferable to necroing an old report with a comment like "still happens in version x.y.z", even if you think the bug is the same, or suspect of a regression.
Thank you for your contribution(s).
NOTE: This ticket will be locked in ~30 Days to avoid any necroing.