diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-10-10 19:02:40 +0100 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-10-10 19:02:40 +0100 |
commit | a36fcc5d55c1de84ae68c1091ebff2b1c32dc3b7 (patch) | |
tree | 1c22c35065e52c5ae69fa915bd502939be801374 /klm/util/file.hh | |
parent | 8a10fd2856e13489cc10d2c683ecbce687f1e5ff (diff) |
KenLM 8307220
Diffstat (limited to 'klm/util/file.hh')
-rw-r--r-- | klm/util/file.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/klm/util/file.hh b/klm/util/file.hh index 8af1ff4f..185cb1f3 100644 --- a/klm/util/file.hh +++ b/klm/util/file.hh @@ -80,6 +80,7 @@ void ReadOrThrow(int fd, void *to, std::size_t size); std::size_t ReadOrEOF(int fd, void *to_void, std::size_t amount); void WriteOrThrow(int fd, const void *data_void, std::size_t size); +void WriteOrThrow(FILE *to, const void *data, std::size_t size); void FSyncOrThrow(int fd); @@ -90,6 +91,8 @@ void SeekEnd(int fd); std::FILE *FDOpenOrThrow(scoped_fd &file); +std::FILE *FOpenOrThrow(const char *path, const char *mode); + class TempMaker { public: explicit TempMaker(const std::string &prefix); @@ -98,9 +101,6 @@ class TempMaker { int Make() const; std::FILE *MakeFile() 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_; }; |