long file name

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
User avatar
jimspoon
Bronze Member
Bronze Member
Posts: 139
Joined: 2002 Aug 22, 00:02

long file name

Post by jimspoon »

Shouldn't be getting this in 5.2.0.0 x64 ULT?

Rejected filename is "2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf"

Path is "E:\data\jsw\documents\docs\business accounts\jsw\storage\alamo mini storage\2022.07.01.04.32.alamoministorage-$180.00 - rent payment\2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments"

My understanding was that paths up to 32657 were OK so long as no component of the path was >255? Longest component here is 107.

Image
User avatar
nikos
Site Admin
Site Admin
Posts: 15522
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: long file name

Post by nikos »

try using CTRL+F2 to rename if it is borderline >255 characters
Robert2
Gold Member
Gold Member
Posts: 669
Joined: 2004 Jun 17, 15:39

Re: long file name

Post by Robert2 »

For test purposes in Windows 10 Home 64bit:
1. I created a folder named "data\jsw\documents\docs\business accounts\jsw\storage\alamo mini storage\2022.07.01.04.32.alamoministorage-$180.00 - rent payment\2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments" on my E: drive. No apparent problem so far. Alt+C gave "E:\data_jsw_documents_docs_business accounts_jsw_storage_alamo mini storage_2022.07.01.04.32.alamoministorage-$180.00 - rent payment_2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments" as the folder path.

2. I created a file named "2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf" in a folder named "E:\TEMPZ". No apparent problem so far. Alt+C gave "E:\TEMPZ\2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf" as the file path.

3. I copied "E:\TEMPZ\2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf" to "E:\data_jsw_documents_docs_business accounts_jsw_storage_alamo mini storage_2022.07.01.04.32.alamoministorage-$180.00 - rent payment_2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments". No apparent problem so far. Alt+C gave "E:\data_jsw_documents_docs_business accounts_jsw_storage_alamo mini storage_2022.07.01.04.32.alamoministorage-$180.00 - rent payment_2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments\2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf" as the file path. Note that it includes 307 characters...

4. Using Ctrl+F2, I tried to rename "2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf" to "411469386.pdf" in "E:\data_jsw_documents_docs_business accounts_jsw_storage_alamo mini storage_2022.07.01.04.32.alamoministorage-$180.00 - rent payment_2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments". No error message after clicking the OK button, but the file was simply not renamed. Its original long name was kept by Windows.

5. I tried to use Robust Delete (Shift+Del) to remove "2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf" from its host folder ("E:\data_jsw_documents_docs_business accounts_jsw_storage_alamo mini storage_2022.07.01.04.32.alamoministorage-$180.00 - rent payment_2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments"). I got an error message from xplorer²: "Error reading from source. Windows error=3. Can't find specified file path.

6. I tried to use the Del key on its own to remove that same PDF file. I got a message asking if I wanted to permanently delete it. I clicked "Yes". The PDF file was removed from its host folder, and could not be located in the Recycle Bin...

7. I could remove "E:\data_jsw_documents_docs_business accounts_jsw_storage_alamo mini storage_2022.07.01.04.32.alamoministorage-$180.00 - rent payment_2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments" as the host folder with Robust Delete.

HTH
Robert
User avatar
jimspoon
Bronze Member
Bronze Member
Posts: 139
Joined: 2002 Aug 22, 00:02

Re: long file name

Post by jimspoon »

Wow, Robert2, thanks so much for this info!

I've encountered long file name / long path issues before - I need to refresh my memory about them. I just dug up and old forum post of mine about it, you might want to have a look -

https://www.voidtools.com/forum/viewtop ... 138#p39138
https://github.com/clechasseur/pathcopycopy/issues/146

You may already know, there's a registry key that's needed for long path support :
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001

I tried Ctrl+F2 as Nikos suggested with the file I mentioned above, all I got was a "ding".
Robert2
Gold Member
Gold Member
Posts: 669
Joined: 2004 Jun 17, 15:39

Re: long file name

Post by Robert2 »

Correction.

1. "long path support" is enabled in my registry.

2. I had tried to create your folder structure at one go, but as you might have noticed in my previous post, xplorer² changed the backslash characters to underscore. So my previous test was actually useless.

3. So I tried to create a complex folder structure through CMD and PowerShell. For mysterious reasons, both balked at "business accounts" as a folder name. maybe it was the space character...

4. I then created your folder structure manually, one subfolder at a time. No problem.

5. I copied my dummy "2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf" file to "E:\data\jsw\documents\docs\business accounts\jsw\storage\alamo mini storage\2022.07.01.04.32.alamoministorage-$180.00 - rent payment". No problem.

6. I could copy that file path through Alt+C. No problem.

7. I was able to rename it with Ctrl+F2, and to delete that PDF file through Robust Delete (Shift Del) without any problem.

So it appears that your problem with long file path names are specific to your system.
User avatar
jimspoon
Bronze Member
Bronze Member
Posts: 139
Joined: 2002 Aug 22, 00:02

Re: long file name

Post by jimspoon »

thanks again Robert.

You mentioned that you copied the file to the folder:

E:\data\jsw\documents\docs\business accounts\jsw\storage\alamo mini storage\2022.07.01.04.32.alamoministorage-$180.00 - rent payment

Together with the file name "2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf", the total path length would be 196.

My target folder was actually had one more level:

E:\data\jsw\documents\docs\business accounts\jsw\storage\alamo mini storage\2022.07.01.04.32.alamoministorage-$180.00 - rent payment\2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments

When the filename is added, the total length is 304.

If you don't mind checking, does the problem arise on your system if you add this extra directory to the target path?

Thanks!
User avatar
jimspoon
Bronze Member
Bronze Member
Posts: 139
Joined: 2002 Aug 22, 00:02

Re: long file name

Post by jimspoon »

I successfully made a file with the following path (no file extension):

C:\nnnnnnnnn1nnnnnnnnn2nnnnnnnnn3nnnnnnnnn4nnnnnnnnn5nnnnnnnnn6nnnnnnnnn7nnnnnnnnn8nnnnnnnnn9nnnnnnnnn0nnnnnnnnn1nnnnnnnnn2nnnnnnnnn3nnnnnnnnn4nnnnnnnnn5nnnnnnnnn6nnnnnnnnn7nnnnnnnnn8nnnnnnnnn9nnnnnnnnn0nnnnnnnnn1nnnnnnnnn2nnnnnnnnn3\nnnnnnnnn1nnnnnnnnn2nnnnn

So that's 230 characters in the folder name, and 25 in the file name. Not counting the drive letter, the colon, and the two backslashes.

And attempt to add another "n" to the filename fails - whether I use F2 or Ctrl+F2.

I brought up the file in Voidtools Everything - there it appeared to have 26 characters, not 25. But I was able to add more characters to it to reach 30 characters, and I think it would work for many more characters, so long as the path is under 32767, and the folder and filenames are under 255.
Robert2
Gold Member
Gold Member
Posts: 669
Joined: 2004 Jun 17, 15:39

Re: long file name

Post by Robert2 »

I recreated your folder tree structure on my E: drive. I copied my dummy PDF file to the deepest folder in the tree. Alt+C gave the following file path name:
E:\data\jsw\documents\docs\business accounts\jsw\storage\alamo mini storage\2022.07.01.04.32.alamoministorage-$180.00 - rent payment\2022.08.01.06.13-Alamo Hutto Mini-Storage-jsw8591_gmail_com-Successfully paid for unit 43-23737-attachments\2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf

That’s 304 characters, well above the 255 legacy limit.

I tried to rename the above PDF file to “411469386.pdf” using F2, then Ctrl+F2, both in xplorer² and Windows own file manager. Same result: Windows wouldn’t rename the file. The original file name was kept.

I used Shift+Del to delete that PDF file. It worked.

I recreated your folder tree structure on my E: drive but I removed all space characters from the folder names. I copied my dummy PDF file to the deepest folder in the tree. Alt+C gave the following file path name:

E:\data\jsw\documents\docs\businessaccounts\jsw\storage\alamoministorage\2022.07.01.04.32.alamoministorage-$180.00rentpayment\2022.08.01.06.13-AlamoHuttoMini-Storage-jsw8591_gmail_com-Successfullypaidforunit43-23737-attachments\2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf

Again I tried to rename the above PDF file to “411469386.pdf”. Neither xplorer² nor Windows own file manager were able to rename it.

I tried to open “2022.08.01.04.35.alamoministorage-$180.00-Receipt_411469386.pdf” from the deepest folder in the tree, first in Adobe Acrobat DC, then in Google Chrome, and in MS Edge. Adobe Acrobat DC could not open it: it said “access denied”. The browsers could not open it either: they opened a blank page instead. Only dedicated applications like SumatraPDF and PDF24 Reader could open it. Modern browsers can normally open PDF files. But obviously not from such a deep tree structure.

Maybe you should try to create folder tree structures with shorter mnemonic folder names. Obviously there are legacy constraints.
User avatar
jimspoon
Bronze Member
Bronze Member
Posts: 139
Joined: 2002 Aug 22, 00:02

Re: long file name

Post by jimspoon »

Thanks for looking into this. I imagine broader support for >255 paths will come eventually but I just looked to see if there was any change from Windows 10 (which I use) and Windows 11, and apparently there wasn't.
User avatar
nikos
Site Admin
Site Admin
Posts: 15522
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: long file name

Post by nikos »

there are some problems if you are working in a folder that is close to the limit (255 chars) and its files can exceed the limit
in a borderline folder like this, you could have problems
Post Reply