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
.
Thursday, January 28, 2010
Long file names and paths
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment