File name length ?

T

thinman

My neighbor just upgraded to XP Home (from WinME) and
he now states that when transferring files from his slave drive,
the file names are truncated to 46 characters. Tried the MS
Knowledge Base for help (using "long file name" keyword(s) )
but got nothing relevant.

I'm running Win98 FE and I told him , as far as I knew, the
long file name length should still be 250 +/-.

Any ideas ?

ray
 
Y

Yves Leclerc

The file name in not limited to 46 characters. However, the
folder/directory names are limited.
 
D

Dave

If I'm remembering correctly, the file name length on XP is 215...don't
know why it was reduced from 255 but it was...
Have your friend try using sfc.exe. This program will check for corrupt
or bad system files and will replace them. Just run it from a command
prompt.
 
A

Alex Nichol

thinman said:
My neighbor just upgraded to XP Home (from WinME) and
he now states that when transferring files from his slave drive,
the file names are truncated to 46 characters. Tried the MS
Knowledge Base for help (using "long file name" keyword(s) )
but got nothing relevant.

I'm running Win98 FE and I told him , as far as I knew, the
long file name length should still be 250 +/-.

That is correct, but there is also a similar limit on the total length
of the 'fully qualified' path\filename and he may be running into that
if the path to the folder he is moving things too is longer than the
one on the other drive
 
D

David Candy

see \\?\
File Name Conventions
Although each file system can have specific rules about the formation of individual components in a directory or file name, all file systems follow the same general conventions: a base file name and an optional extension, separated by a period. For example, the MS-DOS FAT file system supports 8 characters for the base file name and 3 characters for the extension. This is known as an 8.3 file name. The FAT file system and NTFS support file names that can be up to 255 characters long. This is known as a long file name. To get an MS-DOS file name given a long file name, use the GetShortPathName function. To get the full path of a file, use the GetFullPathName function.

Both file systems use the backslash (\) character to separate directory names and the file name when forming a path.

General rules for applications creating names for directories and files or processing names supplied by the user include the following:

a.. Use any character in the current code page for a name, but do not use a path separator, a character in the range 0 through 31, or any character explicitly disallowed by the file system. A name can contain characters in the extended character set (128-255).
b.. Use the backslash (\), the forward slash (/), or both to separate components in a path. No other character is acceptable as a path separator. Note that UNC names must adhere to the following format: \\server\share.
c.. Use a period (.) as a directory component in a path to represent the current directory.
d.. Use two consecutive periods (..) as a directory component in a path to represent the parent of the current directory.
e.. Use a period (.) to separate the base file name from the extension in a directory name or file name.
f.. Do not use the following characters in directory names or file names, because they are reserved:
< > : " / \ |

g.. Do not use device names, such as aux, con, lpt1, and prn, as file names or directory names.
h.. Process a path as a null-terminated string. The maximum length for a path, including a trailing backslash, is given by MAX_PATH.
The Unicode versions of several functions permit paths that exceed the MAX_PATH length if the path has the "\\?\" prefix. The "\\?\" tells the function to turn off path parsing. However, each component in the path cannot be more than MAX_PATH characters long. Use the "\\?\" prefix with paths for local storage devices and the "\\?\UNC\" prefix with paths having the Universal Naming Convention (UNC) format. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps".

i.. Do not assume case sensitivity. Consider names such as OSCAR, Oscar, and oscar to be the same.
j.. The following reserved words cannot be used as the name of a file: CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also, reserved words followed by an extension-for example, NUL.tx7-are invalid file names.
By following the rules listed in this section, an application can create valid names for files and directories regardless of the file system in use.

Backslashes (\) are used as element dividers in paths (dividing the file name from the path to it, or directories from one another in a path). You cannot use them in file or directory names. They may be required as part of volume names (for example, "C:\").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top