long pathnames > 260 < 32767, filenames > 255

General discussion related to "Everything".
Post Reply
jimspoon
Posts: 187
Joined: Tue Apr 26, 2011 11:39 pm

long pathnames > 260 < 32767, filenames > 255

Post by jimspoon »

UPDATE: I installed the latest version 3.88.1 of Advanced Renamer and it was able to rename a file with path name = 292 characters. The long path support issue had been raised in the AR forum. I have the latest version of PathCopyCopy 19.0 installed and I've raised the issue in the PCC github page. Until then - I can use Everything to copy that long path!

I'm trying to get a clear understanding of what I can do and what I can expect re pathnames > 260 characters.

I was using my usual bulk renaming tool - Advanced Renamer - and I saw that some file renaming attempts were rejected with an error message. I think the error message was path not found, with no reference to the path being too long. On the other hand, when I did the same rename on a single file in Everything 1.4 - it was accepted. Still, when I tried to copy the full path and filename to clipboard using my PathCopyCopy shell extension, only the folder path was copied; the filename was left off. But when I used the Everything context menu option "Copy Full Path to Clipboard" - the entire path and filename was copied to the clipboard. I determined that the total path + file length of that file was 292. I also checked to see that I had enabled long path support - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled was set to 1 as required. But even though I had enabled long paths, still Advanced Renamer and PathCopyCopy don't seem to be able to handle them.

So why was Everything able to set and copy the filename while Advanced Renamer and PathCopyCopy failed? I did find this at https://docs.microsoft.com/en-us/window ... n?tabs=cmd:
The application manifest must also include the longPathAware element.

XML
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</windowsSettings>
</application>
So maybe Everything has the required support and element in the application manifest while the other programs do not?

Also - while the LongPathEnabled registry key enables support of pathnames < 32767 characters, it seems that filenames and folder names must still be > 255 (256?) characters. Even in Everything, when I tried to rename a file with a name > 256 characters, a message was displayed that filenames can't be longer than 255. Also when I tried to save a file with a name > 255 in the usual Save As dialog, that was rejected. It seems a bit odd to limit file/folder names this way if pathnames up to 32767 are allowed.
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: long pathnames > 260 < 32767, filenames > 255

Post by void »

So why was Everything able to set and copy the filename
The Windows shell (Context menus, copy and move dialogs, preview handlers, icons and thumbnail handlers) is limited to 259 characters.

"Copy Full Path to Clipboard" does not use the Windows shell.
"Copy Full Path to Clipboard" is added to the context menu after the shell context menu is built.

The LongPathEnabled setting is not needed, Everything uses \\?\ paths internally for very long path support (up to 32000 characters)



The Windows shell can access very long paths with the short path, for example:
C:\Progra~1\Everyt~1\...

Some shell extensions/functions will still fail when the path is eventually expanded and exceeds 259 characters.

Even in Everything, when I tried to rename a file with a name > 256 characters
It's a limitation with most file systems.
The FAT and NTFS file systems are limited to 255 characters for a file or folder name.
Post Reply