PDA

View Full Version : Long Filename are not treated correctly


Infinity
17-Apr-2006, 01: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, 04: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, 04: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, 05: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, 05:26 PM
Yes, I am running version 2.4.1

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