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

Как скопировать файл на диск(дискету,диск) с заменой уже существу   Найти похожие ветки 

← →
dreds   (2004-01-21 10:37) [0]

1) Как скопировать файл на диск(дискету,диск) с заменой уже существующего(без запроса на замену).
2) Возможно ли скопировать файл на диск с предварительным архививированием через WinRar(т.е. програмным путем заорхивировать файл скрытно).


← →
Oyster ©   (2004-01-21 10:51) [1]

Не знаю насчет архивирования, а скопировать, по-моему, можно так же, как если бы файла не было. Если CopyFile не помогает, можно написать свою процедуру копирования файлов через нетипизированные файлы.


← →
TUser ©   (2004-01-21 10:55) [2]

Для архивирования есть специальные компоненты. Покопай на torry - выбери, что тебе подходит.


← →
dreds   (2004-01-21 11:09) [3]

Скажите поподробней по поводу CopyFile?


← →
sVic   (2004-01-21 11:28) [4]

http://delphimaster.net/view/1-1074606027/


← →
TLamer ©   (2004-01-21 12:04) [5]

The CopyFile function copies an existing file to a new file.

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
);


Parameters

<...>

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.

Return Values

If the function succeeds, the return value is nonzero.


← →
TLamer ©   (2004-01-21 12:05) [6]

Это для ДОС-овского РАРа

function PackFileRar(SrcDir,SrcFile : string) : string;
var
si:STARTUPINFO;
pi:PROCESS_INFORMATION;
CmdLine,ResFile : string;
begin
ZeroMemory(@si,sizeof(si));
si.cb:=SizeOf(si);
ResFile := SrcDir + ChangeFileExt(SrcFile,".exe");
CmdLine := pathRARfile + "Rar.exe a -y -u -ep -sfx -std " + ResFile +" "+ SrcDir + SrcFile;
if not CreateProcess( nil,
PChar(CmdLine),
nil,
nil,
False,
0,
nil,
nil,
si,
pi )
then PackFileRar := "Error";
WaitForSingleObject( pi.hProcess, INFINITE );
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
PackFileRar := ResFile;
end;



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

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



Память: 0.46 MB
Время: 0.028 c
14-2349
Talla2k
2004-01-10 17:07
2004.02.02
pdf надо разблокировать


1-2150
Dark Hunter
2004-01-20 18:58
2004.02.02
Нарисовать сетку на форме


3-1992
Navi
2004-01-07 16:51
2004.02.02
Установка FB


7-2390
DJ Vano
2003-10-12 15:54
2004.02.02
Кнопки и папки


1-2210
SGU_
2004-01-22 07:05
2004.02.02
Сохранение данных в ЕXCEL




   Наверх