提醒如果是
\\?\或\\.\
开头的路径是有特殊意义的:
Windows NT: You can use paths longer than MAX_PATH characters by calling the wide (W) version of CreateFile and prepending "\\?\" to the path. The "\……
[/Quote]
你要看了源代码才知道,不过我猜想原因是这样
程序尝试往临时目录创建文件(或目录),于是有这样的代码
GetTempPath(&temppath)
CreateFile(temppath+"\\Fit");
它希望temppath得到C:\Users\ggwang\AppData\Local\Temp,然后加上\Fit便得到
C:\Users\ggwang\AppData\Local\Temp\Fit
但是GetTempPath提供的字符串的后面是加了\的,即temppath实际上是
C:\Users\ggwang\AppData\Local\Temp\
而程序员没注意到,于是自己又加了一个\
提醒如果是
\\?\或\\.\
开头的路径是有特殊意义的:
Windows NT: You can use paths longer than MAX_PATH characters by calling the wide (W) version of CreateFile and prepending "\\?\" to the path. The "\\?\" tells the fu……
[/Quote]
提醒如果是
\\?\或\\.\
开头的路径是有特殊意义的:
Windows NT: You can use paths longer than MAX_PATH characters by calling the wide (W) version of CreateFile and prepending "\\?\" to the path. The "\\?\" tells the function to turn off path parsing. This lets you use paths that are nearly 32,000 Unicode characters long. However, each component in the path cannot be more than MAX_PATH characters long. You must use fully-qualified paths with this technique. This also works with UNC names. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "\\?\UNC\tom_1\hotstuff\coolapps" is seen as "\\tom_1\hotstuff\coolapps".
Windows NT: You can use the CreateFile function to open a disk drive or a partition on a disk drive. The function returns a handle to the disk device; that handle can be used with the DeviceIOControl function. The following requirements must be met in order for such a call to succeed:
The caller must have administrative privileges for the operation to succeed on a hard disk drive.
The lpFileName string should be of the form \\.\PHYSICALDRIVEx to open the hard disk x. Hard disk numbers start at zero. For example:
String Meaning
\\.\PHYSICALDRIVE2 Obtains a handle to the third physical drive on the user's computer.
The lpFileName string should be \\.\x: to open a floppy drive x or a partition x on a hard disk. For example:
String Meaning
\\.\A: Obtains a handle to drive A on the user's computer.
\\.\C: Obtains a handle to drive C on the user's computer.