Start to make constructor

This commit is contained in:
Dmitry Borisenko
2020-08-04 02:21:20 +02:00
parent 78fb96d50d
commit 8d31bcb5dd
14 changed files with 106 additions and 9 deletions

View File

@@ -51,7 +51,7 @@ const String readFileString(const String& filename, const String& to_find) {
return res;
}
const String addFile(const String& filename, const String& str) {
const String addFileLn(const String& filename, const String& str) {
String path = filepath(filename);
auto file = LittleFS.open(path, "a");
if (!file) {
@@ -62,6 +62,17 @@ const String addFile(const String& filename, const String& str) {
return "sucсess";
}
const String addFile(const String& filename, const String& str) {
String path = filepath(filename);
auto file = LittleFS.open(path, "a");
if (!file) {
return "failed";
}
file.print(str);
file.close();
return "sucсess";
}
bool copyFile(const String& src, const String& dst, bool overwrite) {
String srcPath = filepath(src);
String dstPath = filepath(dst);