9 printf("usage: %s [-s] filename\n", prog);
12 int main(int argc, char **argv)
22 if (argc < 2 || argc > 3) {
27 if (strcmp(argv[1], "-s") == 0) {
32 fd = open(argv[file_arg], O_RDWR | O_CREAT, 0600);
34 printf("Error opening %s\n", argv[1]);
39 sprintf(buf, "write %d\n", i);
40 rc = write(fd, buf, sizeof(buf));