Показать сообщение отдельно

  #30  
Старый 02.01.2009, 21:53
Dobby007
Познающий
Регистрация: 07.09.2008
Сообщений: 55
С нами: 9302441

Репутация: 57
По умолчанию

Цитата:
Сообщение от _nic  
Код:
HANDLE hFile=CreateFile("\\\\.\\C:\\12321sa.txt",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,F  ILE_ATTRIBUTE_NORMAL,NULL);
http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx
А теперь читаем:
Цитата:
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\<some 256 character path string><NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
...
The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters.
To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\<very long path>". (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
"\\?\" используется, чтобы распознавать строку с путем как уникод-строку и вследствие этого "удалить ограничение в 256 символов" в именах файлов и директорий.
Можно конечно написать у меня в коде CreateFile("\\?\C:\\123sa.txt",...), но здесь то в любом случае меньше 256 сиволов строчка...

Последний раз редактировалось Dobby007; 02.01.2009 в 21:56..
 
Ответить с цитированием