Skip to content

Files names and Tree Structures of more than 256 characters #9531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Shak1990 opened this issue Jul 9, 2022 · 20 comments
Closed

Files names and Tree Structures of more than 256 characters #9531

Shak1990 opened this issue Jul 9, 2022 · 20 comments

Comments

@Shak1990
Copy link

Shak1990 commented Jul 9, 2022

What's the Problem?

image

Please add support for long nested paths and file names of more than 256 characters.

Solution/Idea

Add support for file names more than 256 characters and tree structures longer than 256 characters I think by changing/adding a registry key.

Alternatives

No Idea =/

Priorities

Capability Priority
This proposal will allow developers to accomplish W Must
This proposal will allow end users to accomplish X Should
This proposal will allow developers to accomplish Y Could
This proposal will allow end users to accomplish Z Won't

Files Version

No response

Windows Version

No response

Comments

No response

@Josh65-2201
Copy link
Member

Files already supports this. The limitation is with windows and will have to be disabled from it. there are guides on google for this.

@Shak1990
Copy link
Author

Shak1990 commented Jul 10, 2022

Files already support this. The limitation is with windows and will have to be disabled from it. there are guides on google for this.

Are you sure? because I changed my registry key and followed this guide:
https://helpdeskgeek.com/how-to/how-to-fix-filename-is-too-long-issue-in-windows/

But I am still not able to create a folder with a name length of 260 characters.
Another example is if I create folders inside folders with a total length of 270 for example and when I try to move it from Drive D to F I get the error File name is too long.

I am on Windows 11 latest version and I am using File's latest version from the store.

@Shak1990
Copy link
Author

Shak1990 commented Jul 10, 2022

Moreover, please try for yourself and create a folder with the name "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzlmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" and add another folder with the same name.

You will see that even though you changed the registry key to supporting long file names/paths you are still not able to do so.

@Shak1990
Copy link
Author

Shak1990 commented Jul 10, 2022

Please reopen this feature because it does not work as you said!
Read here:
https://social.technet.microsoft.com/Forums/en-US/4e471b83-10c6-49d4-acb5-6654640b9dff/long-path-setting-not-working?forum=win10itprogeneral

And here:
https://www.adamfowlerit.com/2016/10/windows-max-path-now-lot-bigger/

The problem is Windows supports a Long file path but File explorer does not therefore you can not move or create long path files/folders structures.

@Josh65-2201
Copy link
Member

Josh65-2201 commented Jul 10, 2022

I have tried it. and if file explorer is still giving you the error then you havent done correctly. Did you restart after making the change.

@Shak1990
Copy link
Author

Shak1990 commented Jul 10, 2022

I have tried it. and if file explorer is still giving you the error then you haven't done it correctly. Did you restart after making the change?

Could you let me know what you did differently from me?
I changed this registry key to 1
image
And yes I restarted my computer several times

Did you read the links I send?
This is not my problem if you search on the internet you will find out many people have this problem.

To be clear you are able to do this?
"Moreover, please try for yourself and create a folder with the name "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzlmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" and add another folder with the same name."

Right now I can't do the above, I am trying to create a new folder with a name longer than 256 characters nothing happen, and if I am trying to create a folder with let's say 10 characters that will have more than 265 characters in a total of the tree structure I will get an error like in the feature request image.
The same with copy and paste folder from let's say "D" drive to a nested structure inside "C" I would get an error too that the path name is too long.

@Josh65-2201
Copy link
Member

I have done this and the same way it does work for me. In any case this is a windows issue and not a Files one since it doesnt work for File explorer. Files wont be able to do anything about it.

@gerberasa
Copy link

I managed to create deep folder by sharing the deepest folder, and add new folder remotely. But it only works for another 255 char (you need to share again for next 255 char again.. and again.. , or just use 7-zip file manager as your windows explorer.) This "unlock" will not automatically applied to other folder.
Additionally, even though Window Explorer can then read the deeper folder, it cannot open the file (if any, I cannot create new file text using windows explorer but create with 7-zip instead) with Windows Security - These files can't be opened "Your Internet security settings prevented one or more files from being opened."
I'm imagining if we can do like compressed file do: move them first to temporary folder (that makes filename limitation though..) and then open it from there.

@itayasaf1991xd
Copy link

Why did this close? @Josh65-2201 I tried what @Shak1990 said and he is right you can not create a folder with a name of 250 characters in length inside another folder of the same length.

@Josh65-2201
Copy link
Member

Josh65-2201 commented Apr 13, 2023

This is a Windows limitation it would be the same for other explorers. For whatever reason they remove or changed the way of unlocking it.

@LesFerch
Copy link

I have to agree with itayasaf1991xd. I tested with Windows 11 on Drive C: (fixed NTFS volume) with LongPathsEnabled=1 (rebooted) and I was limited to a maximum path length of 260 characters using either File Explorer or Files.

Using Directory Opus, I created a folder structure with a total path length that was thousands of characters long (10 levels deep). I created each nested folder with a name that was 256 characters long (the max for an individual folder).

File Explorer had no problem navigating the deep structure (whether LongPathsEnabled was set to 1 or 0). Files displayed an 8.3 name for the first nested folder, and then opened File Explorer upon double-clicking the second nested folder.

Both Files and File Explorer were unable to create a folder structure with a total path length that exceeded 260 characters. File Explorer would politely display an error message. Files just ignored the attempt.

@LesFerch
Copy link

LesFerch commented Jul 25, 2023

This is a Windows limitation it would be the same for other explorers. For whatever reason they remove or changed the way of unlocking it.

Maybe take a look at how Directory Opus does it:

Leo, Directory Opus developer, Nov 23 20:

"Behind the scenes, Opus adds the \\?\ prefix automatically for very long paths."

@ezxpro
Copy link

ezxpro commented Mar 22, 2024

This is a Windows limitation it would be the same for other explorers. For whatever reason they remove or changed the way of unlocking it.

I think you're misinformed.

According to Windows' documentation , once the path limitation is disabled windows is able to handle paths of approximately 32,767 characters in length.

I confirmed that works with apps like Windows 10 video player and PDF X-Change editor if you open the files from within the application's file picker. Powershell also can, via specific commands, manage and access those files because it has builtin facilities to call the Windows API directly.

NTFS's latest version also supports long path names, so it's indeed File that is at fault here, since it's perfectly possible to implement it correctly, like the apps I mentioned above do. It's just a question of willing to put the effort into it.

So no, this is not a Windows fault.

@ezxpro
Copy link

ezxpro commented Mar 22, 2024

This is a Windows limitation it would be the same for other explorers. For whatever reason they remove or changed the way of unlocking it.

Maybe take a look at how Directory Opus does it:

Leo, Directory Opus developer, Nov 23 20:

"Behind the scenes, Opus adds the *\?* prefix automatically for very long paths."

Also interesting to notice this, because one way Windows handles long path names, according to the documentation I linked above is to prefix paths with the \?\ token.

Again, it's a question of willing to do it rather than a technical impossibility.
I'd do it myself if I knew C#, but I only program in Python.

@Josh65-2201
Copy link
Member

I seen \\?\ exists since closing and have made an updated issue on this in #14865 as Files can currently read using this.

@ezxpro
Copy link

ezxpro commented Mar 22, 2024

I seen \\?\ exists since closing and have made an updated issue on this in #14865 as Files can currently read using this.

Yes, it seems some people mentioned this in that other issue. It's a hassle to use it like this though, if you have a file tree that looks like this:
image

This is created automatically by a program that was written for Linux, where this pathname limitation doesn't exist. I then am unable to manage these files without the greatest pain.

I have tried a lot of things, but for months I still have not found a definitive solution for this issue, as most apps simply don't care to implement proper handling of long filenames.

@LesFerch
Copy link

LesFerch commented Mar 22, 2024

I have tried a lot of things, but for months I still have not found a definitive solution for this issue, as most apps simply don't care to implement proper handling of long filenames.

@ezxpro Have you tried Directory Opus or XYPlorer? Here's a link to a list I compiled of file managers I tested for long path support:

https://www.tenforums.com/general-support/169574-windows-file-explorer-long-paths-filenames-post2577374.html#post2577374

Note that my testing was not extensive. From comments I've seen around the net, Directory Opus and XYPlorer are the two most complete file managers, but there may be others in the list that suit you better. Unfortunately, none are as pretty as Files.

@ezxpro
Copy link

ezxpro commented Mar 23, 2024

@LesFerch

Thanks for the suggestion. I discovered Directory Opus today. It does the job pretty well. The new problem that I'm finding is that the open source media players out there don't open long file paths either. It's a pain in the ass to deal with this issue altogether.

@LesFerch
Copy link

The new problem that I'm finding is that the open source media players out there don't open long file paths either. It's a pain in the ass to deal with this issue altogether.

@ezxpro Yeah, most apps don't support long paths. You'll probably have to create directory junctions for the media players.

@ezxpro
Copy link

ezxpro commented Apr 2, 2024

The new problem that I'm finding is that the open source media players out there don't open long file paths either. It's a pain in the ass to deal with this issue altogether.

@ezxpro Yeah, most apps don't support long paths. You'll probably have to create directory junctions for the media players.

Hm... Thanks for the suggestion, I didn't know about that workaround.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants