projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GRAPH scatterplot - fixed missing BY variable rendering
[pspp]
/
src
/
data
/
make-file.h
diff --git
a/src/data/make-file.h
b/src/data/make-file.h
index 3861f35109af866978b5938d0bbc34389e6c059b..a2bcc76eb11bdda3ec0917844f0c9b11c1175ced 100644
(file)
--- a/
src/data/make-file.h
+++ b/
src/data/make-file.h
@@
-21,25
+21,27
@@
#include <stdio.h>
#include <sys/types.h>
#include <stdio.h>
#include <sys/types.h>
+struct file_handle;
+
/* Prepares to atomically replace a (potentially) existing file
/* Prepares to atomically replace a (potentially) existing file
- by a new file, by creating a temporary file with the given
- PERMISSIONS bits
in the same directory as *FILE_NAME
.
+ by a new file
.
, by creating a temporary file with the given
+ PERMISSIONS bits.
Special files are an exception: they are not atomically
replaced but simply opened for writing.
Special files are an exception: they are not atomically
replaced but simply opened for writing.
- If successful, stores the temporary file's name in *TMP_NAME
- and a stream for it opened according to MODE (which should be
+ If successful, stores a stream for it opened according to MODE (which should be
"w" or "wb") in *FP. Returns a ticket that can be used to
commit or abort the file replacement. If neither action has
yet been taken, program termination via signal will cause
"w" or "wb") in *FP. Returns a ticket that can be used to
commit or abort the file replacement. If neither action has
yet been taken, program termination via signal will cause
- *TMP_FILE to be unlinked.
+ all resources to be released. The return value must not be
+ explicitly freed.
+
+ The caller is responsible for closing *FP */
- The caller is responsible for closing *FP, but *TMP_NAME is
- owned by the callee. */
-struct replace_file *replace_file_start (const char *file_name,
+struct replace_file *replace_file_start (const struct file_handle *fh,
const char *mode, mode_t permissions,
const char *mode, mode_t permissions,
- FILE **fp
, char **tmp_name
);
+ FILE **fp);
/* Commits or aborts the replacement of a (potentially) existing
file by a new file, using the ticket returned by
/* Commits or aborts the replacement of a (potentially) existing
file by a new file, using the ticket returned by