Page 1 of 2

"Long File Names or Folder Names or Paths"

Posted: 21 Mar 2012 21:45
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?

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

Posted: 22 Mar 2012 05:47
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.

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

Posted: 22 Mar 2012 15:44
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.

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

Posted: 22 Mar 2012 16:11
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. 

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

Posted: 22 Mar 2012 19:13
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.

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

Posted: 22 Mar 2012 19:44
by admin
What's the bug?

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

Posted: 22 Mar 2012 20:50
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.

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

Posted: 23 Mar 2012 05:40
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 ?

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

Posted: 23 Mar 2012 06:55
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.

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

Posted: 07 Oct 2012 12:53
by Raffaelken
i also faced same kind of problem.

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

Posted: 07 Oct 2012 12:54
by admin
Raffaelken wrote:i also faced same kind of problem.
Describe it, please.

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

Posted: 19 Aug 2014 19:43
by andrewop
I tried them all. This is the best. Buy XYplorer now.

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

Posted: 19 Aug 2014 19:47
by admin
LOL, and another trap made click. :biggrin:

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

Posted: 04 Jan 2015 10:08
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

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

Posted: 04 Jan 2015 10:39
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