#t and #f added to language, datetime fixes

This commit is contained in:
2021-10-12 13:26:38 +02:00
parent adca8a452b
commit 4359012190
13 changed files with 90 additions and 55 deletions

View File

@@ -23,12 +23,14 @@ std::string read_file_contents(const std::string &filename) {
return contents;
}
int write_file_contents(const std::string &filename, const std::string &content) {
std::ofstream f;
f.open(filename.c_str());
int result = (f << content) ? 1 : 0;
f.close();
return result;
bool write_file_contents(const std::string &filename, const std::string &content) {
std::ofstream f(filename.c_str());
if (f) {
f << content;
f.close();
return true;
}
return false;
}
MlValue list_dir(const std::string &path) {