Se volete utilizzare le applicazioni di DOS\WINDOWS basta utilizzare
exec('xcopy',concat('"',nomefile1, '" "', nomefile2));
oppure(non l'ho provato):
exec('C:\windows\system32\xcopy', concat('"',nomefile1, '" "', nomefile2));
Comunque il programma:
Program Prog;
var
A, B : file of byte;
v : byte;
S1, S2 : string;
BEGIN
writeln('Inserisci il nome del file');
readln(S1);
writeln('Inserisci il nome della copia');
readln(S2);
Assign(A, S1);
Assign(B, S2);
reset(A);
rewrite(B);
repeat
read(A, v);
write(B, v);
until EOF(A);
close(A);
close(B);
writeln('Fatto');
readln;
END.
funziona(allego l'eseguibile)
|