Open
Description
The documentation of createFile
says @return A File object if successful, NULL if not.
. However the implementation is as follows:
UFile Folder::createFile(const char* fileName, FileMode fmode) {
std::string filePath = this->path + "/" + fileName;
Arduino_UnifiedStorage::debugPrint("[Folder][createFile][INFO] Creating file: " + String(filePath.c_str()));
UFile thisFile;
thisFile.open(filePath.c_str(), fmode);
return thisFile;
}
The function always returns a UFile object.
Either the implementation needs to be adjusted or the documentation updated. In the latter case, there seems to be no way for the user to understand if the operation was successful.