"Long File Names or Folder Names or Paths"

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

"Long File Names or Folder Names or Paths"

Post by Zardoz2293 »

If I perform a "delete" operation on a path that contains either long file or folder names which results in the following dialog messages. Then manual rename of each offending file or folder until they can be deleted. I'm not sure if the Win32 API calls being made to perform the delete operation are the Unicode versions which allow for ~32,767 byte vs the non-Unicode version which limit 260 bytes. It appears that the copy function is using the Unicode version as this is how the files and folders were created in XY. Shouldn't I be able to delete them if I created them from within XY? If this limitation is by design should we not have some warning notification the copy operation will result in files exceeding the 260 byte boundary.
8.png
9.png
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Code: Select all

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

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. 

Note  The maximum path of 32,767 characters is approximate, because the "\\?\" prefix may be expanded to a longer string by the system at run time, and this expansion applies to the total length.
What are your thoughts?
To see the attached files, you need to log into the forum.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

Twisten
Posts: 204
Joined: 27 Apr 2008 10:30

Re: "Long File Names or Folder Names or Paths"

Post by Twisten »

The point is that windows by design doesn't allow the user to create or use such long names, you have to go through the API to bypass the limitation.
Because of that you can't create such files the normal way in WE.
The Recycle Bin will not accept them I suppose because if it did it will only have to give you that error message when you try to restore them.

Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Re: "Long File Names or Folder Names or Paths"

Post by Zardoz2293 »

Twisten wrote:The point is that windows by design doesn't allow the user to create or use such long names, you have to go through the API to bypass the limitation.
:? What point are we talking about? Granted, Win32 API has devolved into a garbage dump. It all depends on what API calls you invoke. My point is it appears XY calls mixed unicode and non-unicode functions. Frankly, it's easy to do, I've seen it done in hundreds of projects.

Twisten wrote:The Recycle Bin will not accept them I suppose because if it did it will only have to give you that error message when you try to restore them.
Cutting to the chase: Why should it be acceptable for XY to create invalid files/folders? If XY can't delete a file or folder from path length restrictions then XY shouldn't create said files or folders which would violate this policy. All it takes is one non-unicode API call in a sea of unicode API calls to break functionality.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

Twisten
Posts: 204
Joined: 27 Apr 2008 10:30

Re: "Long File Names or Folder Names or Paths"

Post by Twisten »

You misunderstand me, its the windows gui/shell that doesn't allow this as a normal operation.
However XYplorer capitalizes on the method available through the API to avoid the limitation, allowing you to access and create such paths.

XYplorer can delete those files, its the recycle bin that will give you problems.

Just turn off the support in Configuration -> Advanced -> Support overlong filenames

Code: Select all

Support overlong filenames

Check it to support filenames with more than 260 characters.

Background: In NTFS, the total length can be up to 32,765 characters with each component limited to 254 characters. The Windows Shell, however, doesn't allow overlong filenames and Shell functions (e.g. Copying, Moving) will fail with items having overlong filenames. However, since it is possible to create items with overlong filenames under NTFS, with Explorer you are stuck when meeting such item: You cannot delete, rename, or move it! Consequently, also XYplorer will fail wherever it uses Shell functions. When Support overlong filenames is enabled, however, XYplorer will resort to Kernel functions that can deal with overlong filenames and thus work around the Shell limitations.

Here is a list of features with support for overlong filenames in XYplorer:

· Browse and search folders. 

· Auto-refresh. 

· Calculating the folder size. 

· Create new folders within folders with overlong names. 

· Inline Rename (Tree and List). 

· Drag and drop overlong files, and cut/copy/paste them via clipboard. Note that the move/copy/delete support for overlong filenames is limited to operations on single items. Note also that the clipboard (tested on XP) will not handle items > 1027 characters.  

· Image preview and thumbnails. 

· Properties (Info Panel). 

· Raw View (Info Panel). 

· readfile, writefile (Scripting commands). 

· Quick File View (menu File). 

· Rename Special (menu File). 

· Swap Names (menu File). 

· Delete (No Recycler!): If you select exactly one file or folder, then -- after the Shell failed -- you are prompted to delete the item permanently. 

· All "Copy Here..." commands (menu File), but only for files, not for folders. 

· All Backup operations: Note that Backup Operations are not affected by the setting of Support overlong filenames! They always support overlong filenames. 

Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Re: "Long File Names or Folder Names or Paths"

Post by Zardoz2293 »

Twisten wrote:XYplorer can delete those files, its the recycle bin that will give you problems.

Just turn off the support in Configuration -> Advanced -> Support overlong filenames

Code: Select all

When Support overlong filenames is enabled, however, XYplorer will resort to Kernel functions that can deal with overlong filenames and thus work around the Shell limitations.
Yes. So if you have "Support overlong filesnames" checked/enabled and XY is using Kernel functions:
  • Why aren't the files/folders being deleted and *not* going to the recycle bin when the path is > 260 bytes? -- This is what I'd expect to see when "Support overlong filenames" is enabled. Not being able to put the specific long path items into the recycle bin is the cost you pay (although this could be achieved -- beyond the scope of this topic). But not being able to delete can be a real nightmare to resolve those > 206 byte path items if there's more than few.
  • Why isn't their a way to warn the end-user the resulting move/copy will exceed 260 bytes and inform/prompt; do you want to take that action? -- In it's current incarnation this seems important to me, if however, the above concern #1 was resolved, then, this would have minimal value.

Code: Select all

Delete (No Recycler!): If you select exactly one file or folder, then -- after the Shell failed -- you are prompted to delete the item permanently.
This implies to me the files would be permanently deleted with path criteria of > 260 bytes, a prompt beforehand. The statement after the colon ":" is in the context of an example and if multiple files/folders are not supported then it should be clearly stated. I'm not sure why this limitation would exist as it's a significant limitation to supporting long path names.

My perspective is > 260 bytes is a necessity for move, copy and delete (even if the long path items are permanently deleted) to function.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

admin
Site Admin
Posts: 67278
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: "Long File Names or Folder Names or Paths"

Post by admin »

What's the bug?

Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Re: "Long File Names or Folder Names or Paths"

Post by Zardoz2293 »

admin wrote:What's the bug?
Folder contents > 260 bytes in length don't get deleted it without having to rename the structure until it's below that length.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

Twisten
Posts: 204
Joined: 27 Apr 2008 10:30

Re: "Long File Names or Folder Names or Paths"

Post by Twisten »

So ... you're requesting the ability to delete a bunch of files (folder content or more than one selected file) that all have an overlong path name at the same time ?
Perhaps with a more detailed warning about the permanent deletion of said multiple files ?

Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Re: "Long File Names or Folder Names or Paths"

Post by Zardoz2293 »

Twisten wrote:So ... you're requesting the ability to delete a bunch of files (folder content or more than one selected file) that all have an overlong path name at the same time ?
Perhaps with a more detailed warning about the permanent deletion of said multiple files ?
If you are going to support long path names, that goes beyond just the copy and move. Delete is a key component to the equation. If I copy a branch which contains thousands of files which are all short names < 260 and put then into another folder, it is possible (done it more than a few times now) where unknowingly they are all now long path names as they all exceed the 260 bytes length from being under the new folder. It's a disaster as you don't know your going to have to pay the piper in the future. XY is a file manager. Obviously one can disable the long path name support, but that feature was and is a significant attraction to the product -- the need for long path names is in my typical workflow. I'm surprised more aren't expressing a concern on this subject. Frankly, I don't care about being notified I'm exceeding 260 bytes as it's native to NTFS, but I do value much the ability to utilize the same paradigm for deleting them when the need arises -- the permanent it totally acceptable for the long path names. However, notification is highly desirable as it alerts you to an action which cannot be undone.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

Raffaelken

Re: "Long File Names or Folder Names or Paths"

Post by Raffaelken »

i also faced same kind of problem.

admin
Site Admin
Posts: 67278
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: "Long File Names or Folder Names or Paths"

Post by admin »

Raffaelken wrote:i also faced same kind of problem.
Describe it, please.

andrewop

Re: "Long File Names or Folder Names or Paths"

Post by andrewop »

I tried them all. This is the best. Buy XYplorer now.

admin
Site Admin
Posts: 67278
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: "Long File Names or Folder Names or Paths"

Post by admin »

LOL, and another trap made click. :biggrin:

michaelbeijer
Posts: 60
Joined: 19 Apr 2014 00:27
Location: Hastings, East Sussex, UK.
Contact:

Re: "Long File Names or Folder Names or Paths"

Post by michaelbeijer »

Hey, a little off-topic perhaps, but is there a way in XYplorer to scan a folder for paths that are too long?

I am trying to use the OneDrive Windows desktop client, but it keeps stalling, telling me:

"A file or folder can't be created because the path is too long"

If I could somehow find them all first and fix them, OneDrive wouldn't keep stopping.

Michael
Translator & Terminologist (http://beijer.uk/)
(System: Windows 7, 64-bit, 27" monitor)

Linkaday
Posts: 398
Joined: 06 Aug 2007 14:40
Location: Hamburg, Germany - Win 11 Home v26H2 x64 1920x1080 (100%)

Re: "Long File Names or Folder Names or Paths"

Post by Linkaday »

Code: Select all

//Report file paths greater than 259 chars
  goto "?len: > 259 /r";
  text report ("{Path}\{Name}<crlf>");
  tab ("lock", ,0);
  #351;
// by Serendipity 
http://www.xyplorer.com/xyfc/viewtopic. ... 990#p59990

XYplorer scanned half a million items in 2 mins something

Post Reply