3 #include "ScopeHelpers.h"
5 bool ReadWholeFile(const char *path
, std::string
&result
, size_t limit
)
7 FDScope
fd(path
, O_RDONLY
);
12 char buf
[0x1000] = {};
13 ssize_t r
= ReadAll(fd
, buf
, sizeof(buf
));
15 result
.append(buf
, r
);
16 if (result
.size() >= limit
) {
20 } else if (r
< 0 && result
.empty()) {