Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-08-08 18:14:47 +0400
committerKenneth Heafield <github@kheafield.com>2012-08-08 18:14:47 +0400
commit2842ac71e7ea73b364e3825bd9b0754aa3852788 (patch)
treee74bf8329f5e6e41d0a81785a342e1d1d18eb8cd /util/file.hh
parenteb4bd5c85d8c71e47f5d1473ae31196a51ee9f35 (diff)
Fix temporary file handling
Diffstat (limited to 'util/file.hh')
-rw-r--r--util/file.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/file.hh b/util/file.hh
index cc986270c..8af1ff4ff 100644
--- a/util/file.hh
+++ b/util/file.hh
@@ -94,9 +94,12 @@ class TempMaker {
public:
explicit TempMaker(const std::string &prefix);
- int Make(std::string *out_name = NULL) const;
+ // These will already be unlinked for you.
+ int Make() const;
+ std::FILE *MakeFile() const;
- std::FILE *MakeFile(std::string *out_name = NULL) const;
+ // This will force you to close the fd instead of leaving it open.
+ std::string Name(scoped_fd &opened) const;
private:
std::string base_;