Lines Matching defs:file
8 * This file may be redistributed under the terms of the
29 static int save_dev(blkid_dev dev, FILE *file)
40 fprintf(file,
44 fprintf(file, " PRI=\"%d\"", dev->bid_pri);
47 fprintf(file, " %s=\"%s\"", tag->bit_name,tag->bit_val);
49 fprintf(file, ">%s</device>\n", dev->bid_name);
55 * Write out the cache struct to the cache file on disk.
63 FILE *file = NULL;
72 DBG(DEBUG_SAVE, printf("skipping cache file write\n"));
78 /* If we can't write to the cache file, then don't even try */
82 printf("can't write to cache file %s\n", filename));
87 * Try and create a temporary file in the same directory so
88 * that in case of error we don't overwrite the cache file.
89 * If the cache file doesn't yet exist, it isn't a regular
90 * file (e.g. /dev/null or a socket), or we couldn't create
91 * a temporary file then we open it directly.
99 file = fdopen(fd, "w");
106 if (!file) {
107 file = fopen(filename, "w");
112 printf("writing cache file %s (really %s)\n",
115 if (!file) {
124 if ((ret = save_dev(dev, file)) < 0)
133 fclose(file);