Thursday, January 28, 2010

Long file names and paths

It was somewhat difficult for me to realize the file name length restriction in Windows. Finally I got it: The file name can only have the length such that the resulting full path will not exceed 260 characters.

E.g.: In C:\SomeDir\ you can create a file with 248 characters in name (including the extension), while in C:\SomeDir\SubDir\ you can use only 241 characters for a file name.

However, file systems used in Windows can handle paths up to 32,760 Unicode characters with each path component no more than 255 characters[1] It is possible to work with such long paths (i.e. exceeding 260 characters) in Windows, although there are some drawbacks. The best I have found regarding this topic is on BCL Team Blog.

Note: If you assign a drive letter to some folder, then working on that "drive", the full path will not contain the original folder anymore. Thus you can create a file, that you cannot work with properly in the original folder (the resulting path too lengthy), but still can be fully accessed on the "drive".

E.g.: Having mapped \\server\some_long_directory_structure\ to a virtual Z: drive, you can create and fully use a file Z:\some_file_with_long_name. However, that file may be difficult to work with when accessed as \\server\some_long_directory_structure\some_file_with_long_name.

Friday, January 15, 2010

TDD Kata

I did Roy Osherove's TDD Kata. It was refreshing and fun. When it came to step 8, my learning was stimulated, too. Well done, Roy!

I even plan to try this when doing pair programming again. I think such an exercise may help the pair to acclimatize.

I wish there was some "TDD Kata of the Day" page...