#include "main.h" //====================================================================== int main(int argc, char **argv) { char buf[12] = "hello world\n"; if ( argc != 2 ) { printf("usage : ./prog04_file_low_level output_file \n"); return 1; } int fd=open(argv[1],O_RDWR); if ( fd < 0 ) { perror("open error"); return 1; } int ok = write(fd, buf, strlen(buf)); if ( ok == -1 ) { perror("write error"); return 1; } close(fd); return 0; } //^^^^^^^^^^^^^^^^^^^^^^^^^^ EOF ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^