Lines Matching full:file
8 * This file may be redistributed under the terms of the
29 static int save_dev(blkid_dev dev, FILE *file)
39 fprintf(file,
43 fprintf(file, " PRI=\"%d\"", dev->bid_pri);
46 fprintf(file, " %s=\"%s\"", tag->bit_name,tag->bit_val);
48 fprintf(file, ">%s</device>\n", dev->bid_name);
54 * Write out the cache struct to the cache file on disk.
62 FILE *file = NULL;
71 DBG(DEBUG_SAVE, printf("skipping cache file write\n"));
77 /* If we can't write to the cache file, then don't even try */
81 printf("can't write to cache file %s\n", filename));
86 * Try and create a temporary file in the same directory so
87 * that in case of error we don't overwrite the cache file.
88 * If the cache file doesn't yet exist, it isn't a regular
89 * file (e.g. /dev/null or a socket), or we couldn't create
90 * a temporary file then we open it directly.
98 file = fdopen(fd, "w");
105 if (!file) {
106 file = fopen(filename, "w");
111 printf("writing cache file %s (really %s)\n",
114 if (!file) {
123 if ((ret = save_dev(dev, file)) < 0)
132 fclose(file);