/* openfile.c */ /* This program contains what you need to open a file */ /* for low level read/write access */ #include #include #include #include char discard[16384]; main() { int fd; int len; fd = open("discard.1", O_CREAT | O_TRUNC | O_WRONLY, S_IREAD | S_IWRITE); len = read(0, discard, sizeof(discard)); write(fd, discard, len); }