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

Вниз

CopyMoveFiles in KOL v2.22   Найти похожие ветки 

 
L`Autour ©   (2006-01-18 08:57) [0]

Использую функцию:
CopyMoveFiles( const FromList, ToList: String; Move: Boolean ): Boolean;

Когда копирую из "Catalog\LongNameFile.ext" в "LongNameFile.ext" все работает.

Но когда хочу скопировать "LongNameFile.ext" в "Catalog\LongNameFile.ext", то во первых появляется диалог, что приемник не понимает длинных имен и просит переименовать файл, а во вторых каталог "Catalog" ищется не в текущем каталоге, а на системном диске. Короткие имена файлов проходят без проблем.


 
ECM ©   (2006-01-18 13:44) [1]

Желательно приводить код, чтобы было понятнее что и как... Попробовал у себя на "пустом" проекте - всё работает без нареканий (Win2K3 FAT32 V2.31  - эта функция там не изменилась, но всё таки прежде чем задавать вопрос, пробуйте на самой последней версии, никто старые версии поддерживать не будет).
CopyMoveFiles - это обертка вокруг Windows Shell API функции SHFileOperation. Вот что по ней говорится в MSDN:

Remarks

You should use fully-qualified path names with this function. Using it with relative path names is not thread-safe.


т.е. в однопоточной программе можно пользоваться относительными путями.
Но ИМХО лучше всегда задавать полный путь...


 
ECM ©   (2006-01-18 13:48) [2]

З.Ы. Вот еще рекомендации MSDN как правильно пользоваться параметрами
FromList и ToList:

pFrom

Address of a buffer to specify one or more source file names. These names must be fully qualified paths. Standard Microsoft® MS-DOS® wild cards, such as "*", are permitted in the file-name position. Although this member is declared as a null-terminated string, it is used as a buffer to hold multiple file names. Each file name must be terminated by a single NULL character. An additional NULL character must be appended to the end of the final name to indicate the end of pFrom.

pTo

Address of a buffer to contain the name of the destination file or directory. This parameter must be set to NULL if it is not used. Like pFrom, the pTo member is also a double-null terminated string and is handled in much the same way. However, pTo must meet the following specifications:
Wildcard characters are not supported.
Copy and Move operations can specify destination directories that do not exist and the system will attempt to create them. The system normally displays a dialog box to ask the user if they want to create the new directory. To suppress this dialog box and have the directories created silently, set the FOF_NOCONFIRMMKDIR flag in fFlags.
For Copy and Move operations, the buffer can contain multiple destination file names if the fFlags member specifies FOF_MULTIDESTFILES.
Pack multiple names into the string in the same way as for pFrom.
Use only fully-qualified paths. Using relative paths will have unpredictable results.



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

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

Наверх




Память: 0.45 MB
Время: 0.052 c
2-1161530492
***mikle***
2006-10-22 19:21
2006.11.05
Глюк в Делфе или у меня?


15-1160646919
GeLLeR
2006-10-12 13:55
2006.11.05
Цитата из учебника биологии за 9 класс:


15-1161264635
Firefly
2006-10-19 17:30
2006.11.05
Apache и PHP на HP-UX


15-1160607272
Бабай
2006-10-12 02:54
2006.11.05
Google Code Search не ищет по Паскалю !


15-1160767066
ProgRAMmer Dimonych
2006-10-13 23:17
2006.11.05
Помогите с задачей, плз





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский