We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 852ef17 commit 0331227Copy full SHA for 0331227
src/UFile.cpp
@@ -161,18 +161,11 @@ size_t UFile::write(const uint8_t* buffer, size_t size) {
161
}
162
163
bool UFile::remove() {
164
- // Remove the file;
165
- if(this->exists() && !path.empty()){
166
- int result = ::remove(path.c_str());
167
- if (result == 0) {
168
- return true;
169
- } else {
170
- // Error occurred while removing the file
171
- return false;
172
- }
173
174
- return false; // Handle the case when the path is not valid
175
+ if (!this->exists() || path.empty()) {
+ return false; // Handle the case when the path is not valid
+ }
+
+ return ::remove(path.c_str()) == 0;
176
177
178
bool UFile::rename(const char* newFilename) {
0 commit comments