Lines Matching defs:file
27 printf("usage: create_image -i <imagesize> [-c] [-f] <file>\n");
28 printf(" -i, --imagesize size of raw partition image file\n");
29 printf(" -f, --file the raw partition image file\n");
39 const char *file = NULL;
45 {"file", required_argument, 0, 'f'},
73 file = optarg;
85 if (file == NULL && optind == argc - 1)
86 file = argv[optind];
88 if (!imageSize || !file)
101 int fd = open(file, O_RDWR | O_CREAT, 0666);
103 fprintf(stderr, "Error: couldn't open file %s (%s)\n", file,
110 fprintf(stderr, "Error: stat()ing file %s failed (%s)\n", file,
116 fprintf(stderr, "Error: type of file %s not supported\n", file);
121 // regular file -- use ftruncate() to resize it
124 fprintf(stderr, "Error: resizing file %s failed (%s)\n", file,
144 fprintf(stderr, "Error: writing to device file %s failed "
145 "(%s)\n", file, strerror(errno));