Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.12.16;
Скачать: CL | DM;

Вниз

Long file path   Найти похожие ветки 

 
bns   (2007-05-31 12:13) [0]

Здравствуйте,

мне надо скопировать на диск файл, его имя вместе с путем (около 300 символов) больше, чем MAX_PATH. Я это сделал с помощью Unicode версии CreateFileW. Теперь этот файл и все директории из его пути лежат на диске. Но открыть его и посмотреть содержимое не удается ничем. Более того, стандартный Explorer отказался его удалять (кстати, без каких-либо сообщений об ошибке).

Есть ли у кого-нибудь идеи или опыт, как открыть/удалить такой файл?

Спасибо.


 
DiamondShark ©   (2007-05-31 15:49) [1]

Как вариант, удалить из командной строки, используя короткие имена.

а вообще-то,

Maximum Path Length
In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters. A path is structured as follows: drive letter, colon, backslash, components separated by backslashes, and a null-terminating character. For example, the maximum path on the D drive is D:\<256 chars>NUL.

The Unicode versions of several functions permit a maximum path length of 32,767 characters, composed of components up to 255 characters in length. To specify such a path, use the "\\?\" prefix. For example, "\\?\D:\<path>". To specify such a UNC path, use the "\\?\UNC\" prefix. For example, "\\?\UNC\<server>\<share>". Note that these prefixes are not used as part of the path itself. They indicate that the path should be passed to the system with minimal modification. An implication of this is that you cannot use forward slashes to represent path separators or a period to represent the current directory.

When using the API to create a directory, the specified path cannot be so long that you could not append an 8.3 file name.

Note that the shell and the file system may have different requirements. It may be possible to create a path with the API that the shell UI cannot handle.

Функция DeleteFileW поддерживает \\?\ имена.



Страницы: 1 вся ветка

Текущий архив: 2007.12.16;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.03 c
15-1195035397
NX
2007-11-14 13:16
2007.12.16
Языки програмирования под АПП?


6-1175877419
SinglCOOLer
2007-04-06 20:36
2007.12.16
SakeMail


4-1179914782
Ангела
2007-05-23 14:06
2007.12.16
Как отследить, какие функции вызывает программа из Dll ?


15-1195313211
IvanJ
2007-11-17 18:26
2007.12.16
Аналог из C++ в Delphi


2-1195662515
Jolik
2007-11-21 19:28
2007.12.16
Посоветуйте, как правильнее организовать веб-сервер...