通用规范告警修改

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong
2023-03-30 12:02:50 +00:00
parent ae78791c9f
commit 95a0a89def
+5 -5
View File
@@ -282,7 +282,7 @@ bool FileEntry::RemoveAllDirInner(const FileEntry &entry)
{ {
string path = entry.GetFilePath().GetPath(); string path = entry.GetFilePath().GetPath();
if (entry.IsFile()) { if (entry.IsFile()) {
#if _WIN32 #ifdef _WIN32
bool result = remove(AdapateLongPath(path).c_str()) == 0; bool result = remove(AdapateLongPath(path).c_str()) == 0;
#else #else
bool result = remove(path.c_str()) == 0; bool result = remove(path.c_str()) == 0;
@@ -299,7 +299,7 @@ bool FileEntry::RemoveAllDirInner(const FileEntry &entry)
return false; return false;
} }
} }
#if _WIN32 #ifdef _WIN32
bool result = rmdir(AdapateLongPath(path).c_str()) == 0; bool result = rmdir(AdapateLongPath(path).c_str()) == 0;
#else #else
bool result = rmdir(path.c_str()) == 0; bool result = rmdir(path.c_str()) == 0;
@@ -315,7 +315,7 @@ bool FileEntry::CreateDirsInner(const string &path, string::size_type offset)
{ {
string::size_type pos = path.find_first_of(SEPARATE.front(), offset); string::size_type pos = path.find_first_of(SEPARATE.front(), offset);
if (pos == string::npos) { if (pos == string::npos) {
#if _WIN32 #ifdef _WIN32
return CreateDirectory(AdapateLongPath(path).c_str(), nullptr) != 0; return CreateDirectory(AdapateLongPath(path).c_str(), nullptr) != 0;
#else #else
return mkdir(path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0; return mkdir(path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0;
@@ -324,7 +324,7 @@ bool FileEntry::CreateDirsInner(const string &path, string::size_type offset)
string subPath = path.substr(0, pos + 1); string subPath = path.substr(0, pos + 1);
if (!Exist(subPath)) { if (!Exist(subPath)) {
#if _WIN32 #ifdef _WIN32
if (!CreateDirectory(AdapateLongPath(subPath).c_str(), nullptr)) { if (!CreateDirectory(AdapateLongPath(subPath).c_str(), nullptr)) {
#else #else
if (mkdir(subPath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) { if (mkdir(subPath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) {
@@ -360,7 +360,7 @@ void FileEntry::FilePath::Init()
} }
} }
#if _WIN32 #ifdef _WIN32
string FileEntry::AdapateLongPath(const string &path) string FileEntry::AdapateLongPath(const string &path)
{ {
if (path.size() >= MAX_PATH -12) { //the max file path can not exceed 260 - 12 if (path.size() >= MAX_PATH -12) { //the max file path can not exceed 260 - 12