Вниз
Скачать: CL | DM;

Как при копировании заменять файл?   Найти похожие ветки 

 
Intell ©   (2003-05-27 16:12) [0]

Я копирую файлы так:
CopyFile("C:\Netlog.txt", "C:\2.txt", true);
но почему-то если такой файл уже существует, то он не заменяется.


 
Anatoly Podgoretsky ©   (2003-05-27 16:15) [1]

Потому что ты ему так сказал, этим управляет третий параметр


 
Skier ©   (2003-05-27 16:16) [2]

Помощь читаем ? Или всё кодируем ?

BOOL CopyFile(

LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);


bFailIfExists

Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.


 
VAleksey ©   (2003-05-27 16:36) [3]


> Skier © (27.05.03 16:16)

+
Еще и результат функции не забудь проверить после работы.


 
Intell ©   (2003-05-27 17:37) [4]

Спасибо!

>Skier
кодируем, кодируем...



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.013 c
14-26669
Maximator Vetera
2003-05-22 14:17
2003.06.09
Самоорганизацию, самоподобие и избыточность в классы!


3-26392
AlexAvz
2003-05-21 15:22
2003.06.09
БД PARADOX


14-26726
Tatiana
2003-05-21 13:47
2003.06.09
Help.


1-26550
alex78
2003-05-28 02:46
2003.06.09
файл массива


14-26692
MetalFan
2003-05-22 12:38
2003.06.09
Worm World Party&WinXP




   Наверх