Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.02.02;
Скачать: 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 вся ветка

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

Наверх




Память: 0.48 MB
Время: 0.023 c
3-1974
Петр
2004-01-09 10:13
2004.02.02
Ошибка с ADOQuery


4-2437
frost
2003-11-26 12:33
2004.02.02
Иконка = тип файла?


3-2026
dimablind
2004-01-09 22:51
2004.02.02
quickreport и число записей


1-2182
Pavor
2004-01-21 10:40
2004.02.02
Предварительный просмотр


4-2415
Bers
2003-11-25 11:10
2004.02.02
WriteFile в чем ошибка???