Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- int main() {
- write(1, "Hello world\n", 13);
- }
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #include <fcntl.h>
- int main(int argc, char **argv) {
- // struct stat *buff;
- // stat(argv[1], buff);
- // long int size = buff->st_size;
- int sursa = open(argv[1], O_RDONLY);
- char continut;
- int dest = open(argv[2], O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
- while (read(sursa, &continut, 1)) {
- write(dest, &continut, 1);
- }
- close(sursa);
- close(dest);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement