Skip to content
Snippets Groups Projects
Commit e856d62a authored by leo.muff's avatar leo.muff
Browse files

started copyf

parent 58a24e4e
No related branches found
No related tags found
No related merge requests found
#include "copy.h" #include "copy.h"
#include <stdio.h>
#include <stdlib.h>
int copy (char* src, char * dst, unsigned int buf_size){
}
\ No newline at end of file
#ifndef _COPYF_H_ #ifndef _COPYF_H_
#define _COPYF_H_ #define _COPYF_H_
int copy (char* src, char * dst, unsigned int buf_size) ;
int copyf (char* src, char * dst, unsigned int buf_size) ;
#endif #endif
#include "copy.h" #include "copy.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#define MEGA 1000000
int copyf (char* src, char * dst, unsigned int buf_size){
FILE* fp = fopen(src, "r");
char* buffer[buf_size+1];
while(fread(buffer, buf_size, 10*MEGA/buf_size, fp)){
if (ferror(fp))
{
printf("Error occured while reading file.");
return -1;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment