mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
can't handle too long file names #5443
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#5443
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 @Sopor on GitHub (Apr 16, 2017).
When a torrent have more than 260 chars qBT can't handle the files correctly. I now need to manually shorten the folder names for the files to be downloaded. qBT should be able to detect that the path including the filename is too long before it started to download and tell the user that the name is too long or there should be some kind of options so qBT do it for you.
The complete path was 267 chars and i believe that qBT then having problems to rename the file (i use !qB as extension on incomplete files). Without !qB the full path was 263 chars but it was including the
t:\and as you can see, this will be 260 chars without the !qB extension and the drive letter.I'm running qBT 3.3.12 x64 in Windows 7
@whench18 commented on GitHub (Apr 16, 2017):
Hi, for problems concerning path too long issues, I suggest you to try the new long path tool. This can help you with all kinds of path too long cases,
@Sopor commented on GitHub (Jun 20, 2017):
Now qBT stopped downloading and i got a message it couldn't find the file (3 times). I then did a Force Resume and it continued to download. Check this path length,
276 chars long was the longest. So now i have 5 files that still ends with !qB because the file length was more than 259 chars.
One thing i don't understand, how can qBT create these files but not rename them?
Total Commander as i use can handle these kind of file names even if i get a warning that some programs can't handle these long file names. Why can't qBT handle them too? Windows can't handle them either. I will get a requester telling me the file name is too long.
Either make qBT to support more than 259 chars in the path+filename or make qBT warn me about it and let me rename the folder / filename before it start.
@OronDF343 commented on GitHub (Dec 24, 2017):
qBittorrent tends to silently fail with these issues. Two examples:
@oddstr13 commented on GitHub (Apr 13, 2018):
Still present on Windows 10, qBittorrent 4.0.4
Even with
HKLM\SYSTEM\CurrentControlSet\Control\FileSystemLongPathsEnabled=1set.MSDN: Naming Files, Paths, and Namespaces
Download and write works, but read & check fails, resulting in repeatedly re-downloading the files which exceed the limit, when set to check after download.
@falfiya commented on GitHub (Oct 27, 2018):
Still present on Windows 10 Pro, Version 1803 (OS Build 17134.345) on qBittorrent v4.1.4 (64-bit). Not sure if it'll fix itself if I set the Win32 long paths in group policy editor to true. I'll give it a go. Same effects as mentioned above.
@Aokromes commented on GitHub (Oct 28, 2018):
true, yesterday i had to change temp download directory to root of hdd to allow me to download a file.
@RobertSpir commented on GitHub (Nov 27, 2018):
Actually, this seems to work when enabling
LongPathsEnabledAND updating qBittorent manifest by addingThe microsoft documentation about maximum path length limitation is not very clear, but both of these things must be present (registry and application manifest) to enable this behavior.
I am able to move torrents to paths that are much longer than 260 chars and qBittorent doesn't seem to have any problem with this.
@OronDF343 commented on GitHub (Dec 13, 2018):
Issue still present in 4.1.4. Duplicates of this issue: #5484 #6716
@1024mb commented on GitHub (Mar 24, 2019):
Any updates about this? I had to rename like 4 torrents yesterday for qB to verify the contents. It was srsly a PITA, everytime I renamed something, qB started to force verify and I had to pause it, for every single folder I was renaming within a single torrent. Thanks.
@Nidhoggur1993 commented on GitHub (May 18, 2019):
Hi, @RobertSpir , sorry for asking you, but where can I edit qBittorrent manifest?
@thalieht commented on GitHub (May 18, 2019):
@sledgehammer999 https://github.com/qbittorrent/qBittorrent/issues/6645#issuecomment-441998613 maybe qBt can do it?
@Chocobo1 commented on GitHub (May 18, 2019):
https://winaero.com/blog/how-to-enable-ntfs-long-paths-in-windows-10/
Seems two things are required:
I would appreciate a verified working PR for this.
Update:
3. This issue is related too: https://github.com/arvidn/libtorrent/issues/3804
@AlexRozen commented on GitHub (Jul 8, 2019):
That doesn't help. I have enabled the policy and created the manifest file. (v4.1.6)
I'm downloading torrent with the longest path 268 characters. It contains:
12 chars of my own download root
20 chars of torrent's root folder
130 chars of torrent's subfolder
120 chars of filename
qBitTorrent successfully writes it to HDD, adding 4 more chars for the ".!qB" extension
So IT CAN write down files without path length restriction, using the appropriate windows API
(there is no such restriction for many years in Windows. Try the FAR manager for example It's only the matter of correct API usage).
But after finishing download process qBitTorrent can't rename that file to the original name. And it also can't use that file for seeding after the application restart.
@RobertSpir commented on GitHub (Jul 8, 2019):
you need to build qbittorent from source with the new manifest, or perhaps use some tool that can edit manifests embedded in exe files
@AlexRozen commented on GitHub (Jul 8, 2019):
@RobertSpir hope you are right. Also hope this to be embedded in the next release.
But it seem's to be wrong way at all to fix an issue, because qBitTorrent already CAN write such files to disk with all their content. Even with 4 extra chars. Even on any version of Windows with NTFS partitions.
I am sure that there are some issues in other parts of code, that are responsible for file renaming/moving and/or file existence checking.
@Sopor commented on GitHub (Jul 8, 2019):
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
Maximum Path Length Limitation
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
@AlexRozen commented on GitHub (Jul 8, 2019):
@Sopor
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation
The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\?" prefix. For example, "\?\D:\very long path".
@Sopor commented on GitHub (Jul 9, 2019):
When i install Python i will get this message:

This is what it will change
@AlexRozen commented on GitHub (Jul 9, 2019):
@Sopor FAR file manager works correctly with any-length file paths for many years since Windows XP without Group Policy or Registry cheats. This API available many years, but a lot of programs still limited to 260 chars. Even early versions of Microsoft .NET framework and Microsoft PowerShell.
Look again. qBitTorrent IS ALREADY ABLE to write down files with 272 chars of full path. Without any hacks and settings. But it can't handle with them (remove .!qb extension and check existence) after full and 100% correct downloading.
@ghost commented on GitHub (Jan 23, 2020):
Qbit has some notorious I/O issues like this that hasn't been fixed till this date.
@FranciscoPombal commented on GitHub (Mar 22, 2020):
Fixed in https://github.com/qbittorrent/qBittorrent/pull/12154, which will land in 4.2.2.