Dumps the contents of a text file to cout, assuming there are only text files.
| 226 | // Dumps the contents of a text file to cout, assuming |
| 227 | // there are only text files. |
| 228 | static void logFile(const Path& path, const string& filename) |
| 229 | { |
| 230 | string filePath = path::join(path.string(), filename); |
| 231 | Try<string> text = os::read(filePath); |
| 232 | if (text.isSome()) { |
| 233 | cout << "Begin file contents of `" << filename << "`:" << endl; |
| 234 | cout << text.get() << endl; |
| 235 | cout << "End file" << endl; |
| 236 | } else { |
| 237 | cout << "File `" << filename << "` not readable: " << text.error() << endl; |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | |
| 242 | // Dumps the contents of all files in the sandbox to cout, assuming |