printf("create file and open to read\n"); int u = (int)argv[2]; u=u-2; int file = creat(argv[1], atoi(argv[2])); if (file == -1) { perror("Error while creating file: "); return 0; }
printf("write to the file \"many street\"\n"); char buff[100] = "one street \n two street"; write(file, buff, strlen(buff)); close(file); //Закрываем файл
printf("create file and open to read\n"); int u = (int)argv[2]; u=u-2; int file = creat(argv[1], atoi(argv[2])); if (file == -1) { perror("Error while creating file: "); return 0; }
printf("write to the file \"many street\"\n"); char buff[100] = "one street \n two street"; write(file, buff, strlen(buff)); close(file); //Закрываем файл