Use SGBinaryFile in a couple more places.

Most importantly, when computing a hash from the on-disk
state.
This commit is contained in:
James Turner
2016-05-07 10:03:48 +01:00
parent 561e451192
commit 6e4da15a58
3 changed files with 3 additions and 3 deletions

View File

@@ -843,7 +843,7 @@ HTTPRepository::failure() const
sha1_init(&info);
char* buf = static_cast<char*>(malloc(1024 * 1024));
size_t readLen;
SGFile f(p.str());
SGBinaryFile f(p.str());
if (!f.open(SG_IO_IN)) {
throw sg_io_exception("Couldn't open file for compute hash", p);
}

View File

@@ -286,7 +286,7 @@ std::string test_computeHashForPath(const SGPath& p)
char* buf = static_cast<char*>(alloca(1024 * 1024));
size_t readLen;
SGFile f(p.str());
SGBinaryFile f(p.str());
f.open(SG_IO_IN);
while ((readLen = f.read(buf, 1024 * 1024)) > 0) {

View File

@@ -46,7 +46,7 @@ std::string readFileIntoString(const SGPath& path)
std::string contents;
size_t readLen;
SGFile f(path.str());
SGBinaryFile f(path.str());
if (!f.open(SG_IO_IN)) {
throw sg_io_exception("Couldn't open file", path);
}