ok ho risolto!!! molte grazie
posto il codice se servisse a qualcuno:
Codice PHP:
#include <stdlib.h>
#include <stdio.h>
#define MAX_FILE_SIZE 4096
int main(int argc, char** argv){
FILE *fs; /* File sorgente */
FILE *fs2; /* File destinatario */
int dim=0; /* Numero di byte letti */
unsigned char buffer[MAX_FILE_SIZE]; /* buffer */
if(argc != 3) return -1;
fs = fopen(argv[1],"rb");
if(fs == NULL){
printf("error open source file: %s\n",argv[1]);
return -1;
}
fs2 = fopen(argv[2],"wb");
if(fs2 == NULL){
printf("error open target file: %s\n",argv[2]);
return -1;
}
while ((dim = fread(buffer, sizeof(char), sizeof(buffer), fs)) > 0){
fwrite(buffer, sizeof(char), dim, fs2);
}
fclose(fs);
fclose(fs2);
return 0;
}