PDA

View Full Version : Long Filename are not treated correctly


Infinity
17-Apr-2006, 02:47 PM
BC does not handle file names over 256 characters correctly. Seems like a bug (to me at least):
1) BC just seems to ignore any filenames longer than 256 characters. A folder comparsion will ignore all files and folders greater than 256 characters.
2) In comparing folders BC if one side has some files greater than 256 characters then the those files are left out of the results even if the other side is shorter than 256 characters.

At minimum I would recommend trapping for this error and telling the user if it happens.

BTW: even though this oddity cost a few hours today, I downloaded BC a week ago and I really like it so far

Chris
17-Apr-2006, 05:08 PM
Where are the long filenames located? What did you use to create the filenames over 255 characters?

Although the limit for NTFS is about 32,000 characters, NTFS filenames in Windows are supposed to be limited to 255 characters (see http://en.wikipedia.org/wiki/NTFS#Limitations).

The 255 character limit is for a filename or path name between slashes, such as

c:\255 characters\255charact.ers

Infinity
17-Apr-2006, 05:51 PM
The long file names were created on "PC1" when copying files from another computer ("PC2"). Using PC2, I opened a windows folder \\PC1\Sharename\ and then copy files from PC2 onto PC1. Turns out there was a little problem. The shared folder on PC1 was about 50 characters deep, the top folder copied on PC2 was only 10 characters deep. The folder on PC2 had some files that where path and name where 220+ character long originally. So add the long files to the extra path length on PC1 and the files were now longer than 255.

So, Windows did copy a number of these long files and created files that ended up over 255 char in length.

I have been tracking them down and deleting them. When I find them and delete them, explorer will say "Can't access this folder. Path is too long." However, I found that renaming the files generally allows them to be deleted. Been really fun trying to find them and get them deleted.

I was using BC during this process, but only to compare, not to copy.

Chris
18-Apr-2006, 06:04 PM
Are you using the latest version of BC, version 2.4.1? We've added several fixes to our handling of long filenames and paths recently, so if you're running an older version that might explain the problem.

It should work fine to install 2.4.1 over the top of an older version.

Infinity
18-Apr-2006, 06:26 PM
Yes, I am running version 2.4.1

Chris
26-Apr-2006, 12:48 PM
Please post an example problematic long path (such as c:\longpath\longfile.ext) and filename and I'll keep looking into this.

rawytsch
12-Oct-2011, 05:58 AM
Hi,

I hope this is the proper thread.

BC 3.3.2 can compare two files of which one has a very long path name (eg. 4024 characters), but it cannot save that very long path name file!

It always throws a "Filename too long" error message.

The file itself is definitely editable and saveable using an editor.

This seems to be a bug, doesn't it?

I have attached a text file with the long path name included and a gif of the error message popup.
831

832

If anyone knows a quick workaround, please post it,

Peter

Craig
12-Oct-2011, 10:40 AM
Hi Peter,

Beyond Compare can open/save/compare files with paths up to 65K characters. Explorer, however, is limited to 260 characters, and the File "Open" and "Save As" dialogs have that same limitation. If you have a path longer than that BC will try to use the DOS 8.3 path instead, which will help in a lot of cases, but if the shortened path is still longer than 260 characters you'll see the "Filename too long" error. It's an operating system limitation, and there's really nothing we can do about it.

The workarounds available:

1) Browse to the file using BC's folder compare rather than using the "Open" dialog in the text compare. "Save" should work as-is, but if you need to use "Save As", make a copy and rename it using the directory compare instead.

2) Rename or move your folder structure so the path isn't as long.

3) Create a junction point (http://en.wikipedia.org/wiki/NTFS_junction_point) with a shorter path and point it at the parent directory. You can use the junction (http://technet.microsoft.com/en-us/sysinternals/bb896768) tool to create it. That would allow you to access the file through a second, shorter path, without modifying your existing folder structure.