mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-11 12:22:14 +08:00
ate sets failbit on some platforms
old-commit-hash: d90136c1d055369024b1223b0ead520f5aad5913
This commit is contained in:
@@ -60,14 +60,15 @@ std::string read_file(const std::string& fn) {
|
||||
if (ifs) {
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
// handle files created on read, e.g. procfs
|
||||
std::stringstream buffer;
|
||||
buffer << ifs.rdbuf();
|
||||
return buffer.str();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
ifs.close();
|
||||
|
||||
// fallback for files created on read, e.g. procfs
|
||||
std::ifstream f(fn);
|
||||
std::stringstream buffer;
|
||||
buffer << f.rdbuf();
|
||||
return buffer.str();
|
||||
}
|
||||
|
||||
int write_file(const char* path, const void* data, size_t size, int flags, mode_t mode) {
|
||||
|
||||
Reference in New Issue
Block a user