Главная страница
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.028 c
4-1180073252
leonidus
2007-05-25 10:07
2007.12.16
Как перерисовать Scroll у TRichEdit`а ?


1-1190356105
KokocIK
2007-09-21 10:28
2007.12.16
Прокрутка роликом в ScrollBox


2-1195900527
Вячеслав
2007-11-24 13:35
2007.12.16
Проблема с формами


2-1195354236
Тип
2007-11-18 05:50
2007.12.16
смена директории


2-1195628090
marik
2007-11-21 09:54
2007.12.16
Помогите разобраться с компанентой