Command Line INterpreter with fixes

This commit is contained in:
IlushaShurupov 2023-07-19 21:29:57 +03:00 committed by Ilya Shurupov
parent 32c7512b69
commit 58db6fe058
14 changed files with 384 additions and 95 deletions

View file

@ -2,8 +2,21 @@
#include "SystemHandle.hpp"
#include <cstdio>
using namespace tp;
bool FileLocation::exists() const {
FILE* file = fopen(mLocation.read(), "r");
if (file) {
// File exists, close it and return 1
fclose(file);
return true;
}
return false;
}
bool File::connect(const FileLocation& location, const FileConnectionType& connectionInfo) {
DEBUG_ASSERT(!mStatus.isOpened());
if (mStatus.isOpened()) return false;