Главная страница
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.041 c
2-1161162629
Karbo_1
2006-10-18 13:10
2006.11.05
Прямой доступ к ячейкам TDBGid


15-1160848270
TUser
2006-10-14 21:51
2006.11.05
Преимущества альтернативных браузеров


15-1161154388
Prohodil Mimo
2006-10-18 10:53
2006.11.05
Можно ли убрать писк в UPSe?


1-1159275874
flaxe
2006-09-26 17:04
2006.11.05
"Перетаскивание" изображений


2-1161530492
***mikle***
2006-10-22 19:21
2006.11.05
Глюк в Делфе или у меня?