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

Вниз

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

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

Наверх




Память: 0.47 MB
Время: 0.054 c
15-1160844416
Kolan
2006-10-14 20:46
2006.11.05
Использование объектов для простых типов. Стоит ли?


2-1161222527
morda
2006-10-19 05:48
2006.11.05
выборка float из mysql


2-1161377554
learner
2006-10-21 00:52
2006.11.05
BDS 2006. record и class.


15-1161157669
Думкин
2006-10-18 11:47
2006.11.05
Головоломки профессора Головоломки. Гершензон


15-1161320986
boalse
2006-10-20 09:09
2006.11.05
Законы Мерфи