diff --git a/Topic-1/main.c b/Topic-1/main.c index a33bec6..14bc305 100644 --- a/Topic-1/main.c +++ b/Topic-1/main.c @@ -3,6 +3,7 @@ #include #include #include +#include #define BUFFER_SIZE 8 @@ -36,6 +37,11 @@ int cp(char *argv[]){ write(new, buffer, read_bytes); } + struct stat mod_bits; + + stat(argv[1], &mod_bits); + chmod(argv[2], mod_bits.st_mode); + close(old); close(new);