DEV/DEV1.1/TP13:Fichiers/copie.c

21 lines
355 B
C
Raw Normal View History

2022-11-23 16:46:05 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argn , char** const argv) {
if ((strcmp(argv[1],"-a"))!=0){
FILE *f;
FILE *l;
int octet;
f=fopen(argv[3],"a");
l=fopen(argv[2],"r");
fread(&octet,1,1,l);
while (!(feof(l))){
fwrite(&octet,1,1,f);
fread(&octet,1,1,l);
fclose(l);
fclose(f);
}
}
return 0;
}