Скачиваний:
17
Добавлен:
08.01.2014
Размер:
677 б
Скачать
uses stdio;

(* уЛПРЙТПЧБФШ ЖБКМ f1 Ч ЖБКМ f2
* РТЙ РПНПЭЙ УФБОДБТФОЩИ РТПГЕДХТ ЧЧПДБ/ЧЩЧПДБ
*)
function copyfile(const f1, f2:pchar):integer;
var
inf, outf:pfile;
c:longint;
begin
inf := fopen (f1, 'r');
if inf = nil then
begin
copyfile:=-1;
exit;
end;
outf := fopen (f2, 'w');
if outf = nil then
begin
fclose (inf);
copyfile:=-2;
exit;
end;
c := getc (inf);
while c <> EOF do
begin
putc (c, outf);
c := getc (inf);
end;
fclose (inf);
fclose (outf);
copyfile:=0;
end;


begin
if argc < 3 then
halt (1);
if copyfile (argv[1], argv[2])<>0 then
begin
perror ('copyfile');
halt (1);
end;
end.
Соседние файлы в папке 11