Exam 42 Rank 02 Install [updated]
int fd_src = open(src, O_RDONLY); int fd_dst = open(tmpname, O_WRONLY | O_CREAT | O_EXCL, 0600); // read/write loop close(fd_src); close(fd_dst); fchmod(fd_dst, final_mode); fchown(fd_dst, owner, group); // if given utime(tmpname, &source_times); // if preserving rename(tmpname, dest);


