Platform SDK: File Storage
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:\").
Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)
--
-------------------------------------------------------------------------- ------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
wumply said:
wumply said:
:
\\?\ means the thing using it wants windows to use paths up to 32 000
characters long. Windows normally applies a 260 character limit
(because that is what most programs expect and all they've allocated
memory for).
================
David and Wesley: THANKS! Pretty interesting. wumply
================
FOLLOW-UP BY wumply (John D. Miller)
DAVID CANDY: You were the only one who had so definitive an answer to my
question. If I may ask what in your experience led to your knowing the
answer? I mean I was far from sure I'd come up with a clear answer - and
this is the 3rd site or group I've tried.
John
==============
--
----------------------------------------------------------------------- ---------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
When I tried to clone my HD with CasperXP, it cloned OK...except
there was this message:
Copying Disk 1 to Disk 2.
ERROR; GetWriterMetadataCount returned VSS_E_BAD_STATE (80042301)
WARNING: volume snapshot failed (error=80042301)
COPY SOURCE ERROR 32: Could not safely access file:
"\\?\C:\WINDOWS\system32\lqfoe89kr.lwp". The following processes are
using this file.
Process Name: aaksrv.exe
Path: C:\Windows\system32\aaksrv.exe.
Services registered in process:
aaksrv [aaksrv]
Copy completed successfully.
Except that it did not copy the lqfoe89kr.lwp file in question!!!
-------
However, after uninstalling and reinstalling the anti keylogger
program from which the lqfoe89kr.lwp file came, I was able to clone
my HDD successfully!!
But my question is this: What's with the \\?\ in the path
\\?\C:\WINDOWS\System32\lqfoe89kr.lwp I've never ever seen such a
beginning of a path. Was it a fluke or does it indicate something?
The people at Casper XP had not run into it, nor did anyone at
www.techguy.org or
www.techzonez.com come up with a conclusive
answer, though 1 reply thought it might be the highest level
'directory'' by which I gathered it to refer to a HD with 1 big
partition.
I'd appreciate any responses or even guesses.