/* open.c */ /* This program contains what you need to open a file */ /* for low level read/write access */ #include #include #include main() { int fd; fd = open("discard.1", O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE); write(fd, "hello\n", 6); close(fd); }