can't handle too long file names #5443

Closed
opened 2026-02-21 17:51:26 -05:00 by deekerman · 21 comments
Owner

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

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
deekerman 2026-02-21 17:51:26 -05:00
Author
Owner

@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,

@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,
Author
Owner

@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,

t:\Torrent_Download\The PROPHECY Series (1995-2005) - 1, 2 II, 3 The Ascent, 4 Uprising, 5 Forsaken - 720p BluRay x264\OTHER Movies and Shows about Angels, Demons, God vs Satan, etc, HERE\DEAD Like ME (2003-2009) - Complete TV Series and Movie - 720p AMZN WebRip x264.txt.!qB

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.

@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, ``` t:\Torrent_Download\The PROPHECY Series (1995-2005) - 1, 2 II, 3 The Ascent, 4 Uprising, 5 Forsaken - 720p BluRay x264\OTHER Movies and Shows about Angels, Demons, God vs Satan, etc, HERE\DEAD Like ME (2003-2009) - Complete TV Series and Movie - 720p AMZN WebRip x264.txt.!qB ``` 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.
Author
Owner

@OronDF343 commented on GitHub (Dec 24, 2017):

qBittorrent tends to silently fail with these issues. Two examples:

  1. When downloading a torrent with long paths, it appears to download it successfully. Upon restarting qBittorrent it fails to recognize files that have a long path. Also, while the torrent is seeding it will report an "I/O error" every time it tries to read one of these files.
  2. When moving a torrent, if the new location will cause some paths to be too long the move silently fails and is rolled back. This behavior is unintuitive.
@OronDF343 commented on GitHub (Dec 24, 2017): qBittorrent tends to silently fail with these issues. Two examples: 1) When downloading a torrent with long paths, it appears to download it successfully. Upon restarting qBittorrent it fails to recognize files that have a long path. Also, while the torrent is seeding it will report an "I/O error" every time it tries to read one of these files. 2) When moving a torrent, if the new location will cause some paths to be too long the move **silently** fails and is rolled back. This behavior is unintuitive.
Author
Owner

@oddstr13 commented on GitHub (Apr 13, 2018):

Still present on Windows 10, qBittorrent 4.0.4
Even with HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled=1 set.
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.

@oddstr13 commented on GitHub (Apr 13, 2018): Still present on Windows 10, qBittorrent 4.0.4 Even with `HKLM\SYSTEM\CurrentControlSet\Control\FileSystem` `LongPathsEnabled=1` set. [MSDN: Naming Files, Paths, and Namespaces](https://msdn.microsoft.com/en-us/library/aa365247.aspx) 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.
Author
Owner

@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.

@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.
Author
Owner

@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.

@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.
Author
Owner

@RobertSpir commented on GitHub (Nov 27, 2018):

Actually, this seems to work when enabling LongPathsEnabled AND updating qBittorent manifest by adding

<asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
      <longPathAware>true</longPathAware>
    </asmv3:windowsSettings>
  </asmv3:application>

The 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.

@RobertSpir commented on GitHub (Nov 27, 2018): Actually, this seems to work when enabling `LongPathsEnabled` AND updating qBittorent manifest by adding ``` <asmv3:application> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> <longPathAware>true</longPathAware> </asmv3:windowsSettings> </asmv3:application> ``` The 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.
Author
Owner

@OronDF343 commented on GitHub (Dec 13, 2018):

Also, while the torrent is seeding it will report an "I/O error" every time it tries to read one of these files.

Issue still present in 4.1.4. Duplicates of this issue: #5484 #6716

@OronDF343 commented on GitHub (Dec 13, 2018): > Also, while the torrent is seeding it will report an "I/O error" every time it tries to read one of these files. Issue still present in 4.1.4. Duplicates of this issue: #5484 #6716
Author
Owner

@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.

@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.
Author
Owner

@Nidhoggur1993 commented on GitHub (May 18, 2019):

Actually, this seems to work when enabling LongPathsEnabled AND updating qBittorent manifest by adding

<asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
      <longPathAware>true</longPathAware>
    </asmv3:windowsSettings>
  </asmv3:application>

The 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.

Hi, @RobertSpir , sorry for asking you, but where can I edit qBittorrent manifest?

@Nidhoggur1993 commented on GitHub (May 18, 2019): > Actually, this seems to work when enabling `LongPathsEnabled` AND updating qBittorent manifest by adding > > ``` > <asmv3:application> > <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> > <longPathAware>true</longPathAware> > </asmv3:windowsSettings> > </asmv3:application> > ``` > > The 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. Hi, @RobertSpir , sorry for asking you, but where can I edit qBittorrent manifest?
Author
Owner

@thalieht commented on GitHub (May 18, 2019):

@sledgehammer999 https://github.com/qbittorrent/qBittorrent/issues/6645#issuecomment-441998613 maybe qBt can do it?

@thalieht commented on GitHub (May 18, 2019): @sledgehammer999 https://github.com/qbittorrent/qBittorrent/issues/6645#issuecomment-441998613 maybe qBt can do it?
Author
Owner

@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:

  1. Updated qBittorent manifest. Full example: https://gist.github.com/riverar/196d5aa6bb53bbdfb50beb323d0709df
    I would appreciate a verified working PR for this.
  2. User manually edit Group Policy or registry.

Update:
3. This issue is related too: https://github.com/arvidn/libtorrent/issues/3804

@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: 1. Updated qBittorent manifest. Full example: https://gist.github.com/riverar/196d5aa6bb53bbdfb50beb323d0709df I would appreciate a verified working PR for this. 2. User manually edit Group Policy or registry. Update: 3. This issue is related too: https://github.com/arvidn/libtorrent/issues/3804
Author
Owner

@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.

@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.
Author
Owner

@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

@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
Author
Owner

@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.

@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.
Author
Owner

@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.)

@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.)
Author
Owner

@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".

@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".
Author
Owner

@Sopor commented on GitHub (Jul 9, 2019):

When i install Python i will get this message:
image

This is what it will change

@Sopor commented on GitHub (Jul 9, 2019): When i install Python i will get this message: ![image](https://user-images.githubusercontent.com/5789283/60909218-f5cd6080-a27d-11e9-94b6-1d18ed0e5443.png) [This is what it will change](https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/)
Author
Owner

@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.

@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.
Author
Owner

@ghost commented on GitHub (Jan 23, 2020):

Qbit has some notorious I/O issues like this that hasn't been fixed till this date.

@ghost commented on GitHub (Jan 23, 2020): Qbit has some notorious I/O issues like this that hasn't been fixed till this date.
Author
Owner

@FranciscoPombal commented on GitHub (Mar 22, 2020):

Fixed in https://github.com/qbittorrent/qBittorrent/pull/12154, which will land in 4.2.2.

@FranciscoPombal commented on GitHub (Mar 22, 2020): Fixed in https://github.com/qbittorrent/qBittorrent/pull/12154, which will land in 4.2.2.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#5443
No description provided.