Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2007.12.16;
Скачать: [xml.tar.bz2];

Вниз

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 вся ветка

Форум: "WinAPI";
Текущий архив: 2007.12.16;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.056 c
2-1195648487
kudatsky
2007-11-21 15:34
2007.12.16
Ограничение на количество открытых DBF-файлов


15-1195079505
Германн
2007-11-15 01:31
2007.12.16
Самое приятное и интересное воспоминание


15-1195110077
БарЛог
2007-11-15 10:01
2007.12.16
Почему "ПУСК"?


4-1180351823
Lex_!
2007-05-28 15:30
2007.12.16
Список оборудования в системе


15-1195120254
WFS
2007-11-15 12:50
2007.12.16
Как переименовать Unit?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский