Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

CopyMoveFiles in KOL v2.22


L`Autour ©   (2006-01-18 08:57:00) 

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

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

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


ECM   (2006-01-18 13:48:00) [1]

З.Ы. Вот еще рекомендации 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.


ECM   (2006-01-18 13:44:00) [2]

Желательно приводить код, чтобы было понятнее что и как... Попробовал у себя на "пустом" проекте - всё работает без нареканий (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.


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


Наверх

Титульная страница Поиск, карта сайта Написать письмо