home *** CD-ROM | disk | FTP | other *** search
- unit copyfile;
-
- interface
- uses crt,dos;
-
- procedure copy(zdroj, cil: string);
-
- implementation
-
- procedure copy(zdroj, cil: string);
- const BufSize=63000;
- var f, temp: file;
- NR, NW: word;
- bufR: array[1..BufSize] of byte;
- begin
- writeln;
- textcolor(14); highvideo;
- writeln(' Fcopy v.1.0');
- writeln(' ──────────────────────────────────────────');
- textcolor(15); lowvideo;
-
- writeln(' [Rychle kopirovani souboru] #JS 320011447]');
- writeln;
- assign(f, zdroj);
- assign(temp,cil);
- {$I-} reset(f,1); {$I+}
- if IOresult<>0 then begin
- write(chr(7));
- writeln(' Chyba: ',zdroj,' neexistuje!');
- exit;
- end;
-
- {$I-}
- rewrite(temp,1);
- {$I+}
- if IOresult<>0 then begin
- close(f);
- write(chr(7));
- writeln(' Chyba - nelze vytvorit cilovy soubor!');
- exit;
- end;
-
- {$I-}
- Blockread(f,BufR,BufSize,NR);
- {$I+}
- if IOresult<>0 then begin
- close(f); close(temp); erase(temp);
- write(chr(7));
- writeln(' Doslo k chybe pri cteni!');
- exit;
- end;
-
- writeln(' Kopiruji soubor ...');
- repeat
- NW:=NR;
- {$I-}
- BlockWrite(temp,BufR,NW,NR);
- Blockread(f,Bufr,BufSize,NR);
- {$I+}
- if IOresult<>0 then begin
- close(f); close(temp); erase(temp);
- write(chr(7));
- writeln(' Doslo k chybe pri zapisu!');
- exit;
- end;
- until NR=0;
- close(f); close(temp);
-
- end;
- BEGIN
- END.