Skip to content
Snippets Groups Projects
Commit ddc172ab authored by stephane.chappuis1's avatar stephane.chappuis1
Browse files

ça marche olé

parent 1019f8ed
No related branches found
No related tags found
No related merge requests found
...@@ -15,5 +15,5 @@ copyf.o: copyf.c copy.h ...@@ -15,5 +15,5 @@ copyf.o: copyf.c copy.h
$(CC) -c copyf.c -o copyf.o $(CC) -c copyf.c -o copyf.o
clean: clean:
rm -f $(OBJS) copybench.o copybench rm -f $(OBJS) copybench.o copybench copyimage.jpg
...@@ -15,7 +15,7 @@ int copy(char *src, char *dst, unsigned int buf_size) ...@@ -15,7 +15,7 @@ int copy(char *src, char *dst, unsigned int buf_size)
return -1; return -1;
} }
dest_file = open(dst, O_CREAT | O_RDONLY | O_TRUNC, 0644); dest_file = open(dst, O_CREAT | O_WRONLY | O_TRUNC, 0644);
if (dest_file < 0) if (dest_file < 0)
{ {
......
File deleted
File deleted
...@@ -38,9 +38,9 @@ int main(int argc, char *argv[]) { ...@@ -38,9 +38,9 @@ int main(int argc, char *argv[]) {
char *dst = argv[2]; char *dst = argv[2];
measure_copy_time(src, dst, 1, 0); measure_copy_time(src, dst, 1, 0);
// measure_copy_time(src, dst, 32768, 0); measure_copy_time(src, dst, 32768, 0);
// measure_copy_time(src, dst, 1, 1); measure_copy_time(src, dst, 1, 1);
// measure_copy_time(src, dst, 32768, 1); measure_copy_time(src, dst, 32768, 1);
return 0; return 0;
} }
\ No newline at end of file
...@@ -7,9 +7,9 @@ int copyf(char *src, char *dst, unsigned int buf_size){ ...@@ -7,9 +7,9 @@ int copyf(char *src, char *dst, unsigned int buf_size){
char *buffer; char *buffer;
int total_byte = 0; int total_byte = 0;
src_file = fopen(src, "wb"); src_file = fopen(src, "r");
if (src_file != NULL) if (src_file == NULL)
{ {
fprintf(stderr, "Error opening source file %s: %s\n", src, strerror(errno)); fprintf(stderr, "Error opening source file %s: %s\n", src, strerror(errno));
return -1; return -1;
...@@ -17,7 +17,7 @@ int copyf(char *src, char *dst, unsigned int buf_size){ ...@@ -17,7 +17,7 @@ int copyf(char *src, char *dst, unsigned int buf_size){
dest_file = fopen(dst,"w") ; dest_file = fopen(dst,"w") ;
if (dest_file != NULL) if (dest_file == NULL)
{ {
fprintf(stderr, "Error opening destination file %s: %s\n", dst, strerror(errno)); fprintf(stderr, "Error opening destination file %s: %s\n", dst, strerror(errno));
fclose(src_file); fclose(src_file);
......
File deleted
TP_PROG_SYS_COPYBENCH/image.jpg

749 KiB | W: | H:

TP_PROG_SYS_COPYBENCH/image.jpg

291 KiB | W: | H:

TP_PROG_SYS_COPYBENCH/image.jpg
TP_PROG_SYS_COPYBENCH/image.jpg
TP_PROG_SYS_COPYBENCH/image.jpg
TP_PROG_SYS_COPYBENCH/image.jpg
  • 2-up
  • Swipe
  • Onion skin
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment