summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/file_util.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index df234c225..d3cc371de 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -118,8 +118,7 @@ bool IsDirectory(const std::string& filename) {
118#endif 118#endif
119 119
120 if (result < 0) { 120 if (result < 0) {
121 LOG_WARNING(Common_Filesystem, "stat failed on %s: %s", filename.c_str(), 121 LOG_DEBUG(Common_Filesystem, "stat failed on %s: %s", filename.c_str(), GetLastErrorMsg());
122 GetLastErrorMsg());
123 return false; 122 return false;
124 } 123 }
125 124
@@ -129,12 +128,12 @@ bool IsDirectory(const std::string& filename) {
129// Deletes a given filename, return true on success 128// Deletes a given filename, return true on success
130// Doesn't supports deleting a directory 129// Doesn't supports deleting a directory
131bool Delete(const std::string& filename) { 130bool Delete(const std::string& filename) {
132 LOG_INFO(Common_Filesystem, "file %s", filename.c_str()); 131 LOG_TRACE(Common_Filesystem, "file %s", filename.c_str());
133 132
134 // Return true because we care about the file no 133 // Return true because we care about the file no
135 // being there, not the actual delete. 134 // being there, not the actual delete.
136 if (!Exists(filename)) { 135 if (!Exists(filename)) {
137 LOG_WARNING(Common_Filesystem, "%s does not exist", filename.c_str()); 136 LOG_DEBUG(Common_Filesystem, "%s does not exist", filename.c_str());
138 return true; 137 return true;
139 } 138 }
140 139
@@ -169,8 +168,7 @@ bool CreateDir(const std::string& path) {
169 return true; 168 return true;
170 DWORD error = GetLastError(); 169 DWORD error = GetLastError();
171 if (error == ERROR_ALREADY_EXISTS) { 170 if (error == ERROR_ALREADY_EXISTS) {
172 LOG_WARNING(Common_Filesystem, "CreateDirectory failed on %s: already exists", 171 LOG_DEBUG(Common_Filesystem, "CreateDirectory failed on %s: already exists", path.c_str());
173 path.c_str());
174 return true; 172 return true;
175 } 173 }
176 LOG_ERROR(Common_Filesystem, "CreateDirectory failed on %s: %i", path.c_str(), error); 174 LOG_ERROR(Common_Filesystem, "CreateDirectory failed on %s: %i", path.c_str(), error);
@@ -182,7 +180,7 @@ bool CreateDir(const std::string& path) {
182 int err = errno; 180 int err = errno;
183 181
184 if (err == EEXIST) { 182 if (err == EEXIST) {
185 LOG_WARNING(Common_Filesystem, "mkdir failed on %s: already exists", path.c_str()); 183 LOG_DEBUG(Common_Filesystem, "mkdir failed on %s: already exists", path.c_str());
186 return true; 184 return true;
187 } 185 }
188 186
@@ -197,7 +195,7 @@ bool CreateFullPath(const std::string& fullPath) {
197 LOG_TRACE(Common_Filesystem, "path %s", fullPath.c_str()); 195 LOG_TRACE(Common_Filesystem, "path %s", fullPath.c_str());
198 196
199 if (FileUtil::Exists(fullPath)) { 197 if (FileUtil::Exists(fullPath)) {
200 LOG_WARNING(Common_Filesystem, "path exists %s", fullPath.c_str()); 198 LOG_DEBUG(Common_Filesystem, "path exists %s", fullPath.c_str());
201 return true; 199 return true;
202 } 200 }
203 201
@@ -229,7 +227,7 @@ bool CreateFullPath(const std::string& fullPath) {
229 227
230// Deletes a directory filename, returns true on success 228// Deletes a directory filename, returns true on success
231bool DeleteDir(const std::string& filename) { 229bool DeleteDir(const std::string& filename) {
232 LOG_INFO(Common_Filesystem, "directory %s", filename.c_str()); 230 LOG_TRACE(Common_Filesystem, "directory %s", filename.c_str());
233 231
234 // check if a directory 232 // check if a directory
235 if (!FileUtil::IsDirectory(filename)) { 233 if (!FileUtil::IsDirectory(filename)) {