]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsys.c
Implement restore files
[bacula/bacula] / bacula / src / lib / bsys.c
index 5a39359605ca39c5fa36e155313a12a775677bd7..5141515ff1c8c32c7152808e4e59693ed23f48bf 100644 (file)
@@ -469,3 +469,15 @@ char *bfgets(char *s, int size, FILE *fd)
    }
    return s;
 }
+
+/*
+ * Make a "unique" filename.  It is important that if
+ *   called again with the same "what" that the result
+ *   will be identical. This allows us to use the file
+ *   without saving its name, and re-generate the name
+ *   so that it can be deleted.
+ */
+void make_unique_filename(POOLMEM **name, int Id, char *what)
+{
+   Mmsg(name, "%s/%s.%s.%d.tmp", working_directory, my_name, what, Id);
+}