Skip to content
Snippets Groups Projects
Commit dad302a3 authored by iliya.saroukha's avatar iliya.saroukha
Browse files

working on close

parent 14e886bc
Branches
No related tags found
No related merge requests found
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include "lib_fs.h"
// int copy(char *src, char *dst, unsigned int buf_size)
// {
int copy(char *src, char *dst, unsigned int buf_size)
{
int fd_src = open(src, O_RDONLY);
int fd_dst = open(dst, O_WRONLY | O_CREAT, 0640);
// }
close(fd_src);
close(fd_dst);
}
int copyf(char *src, char *dst, unsigned int buf_size)
{
......
......@@ -15,7 +15,7 @@ int main(int argc, char **argv)
char *src = "./src.txt";
char *dst = "./dst.txt";
fprintf(stdout, "\nNumber of bytes copied: %d\n", copyf(src, dst, atoi(argv[1])));
fprintf(stdout, "\ncopyf(char %s, char %s, unsigned int %d)\tNumber of bytes copied: %d\n", src, dst, atoi(argv[1]), copyf(src, dst, atoi(argv[1])));
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment