diff --git a/interfaces/kits/js/src/mod_fs/properties/move_core.cpp b/interfaces/kits/js/src/mod_fs/properties/move_core.cpp index 56961567c88d1b6a4e52373b245f70b01b7eac63..a0b823ea18493c5e54af1a8c4d4fedd85f2088c5 100644 --- a/interfaces/kits/js/src/mod_fs/properties/move_core.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/move_core.cpp @@ -147,14 +147,8 @@ static int RenameFile(const string &src, const string &dest) static int MoveFile(const string &src, const string &dest, int mode) { uv_fs_t access_req; - int ret = uv_fs_access(nullptr, &access_req, src.c_str(), W_OK, nullptr); - if (ret < 0) { - HILOGE("Failed to move src file due to doesn't exist or hasn't write permission"); - uv_fs_req_cleanup(&access_req); - return ret; - } if (mode == MODE_THROW_ERR) { - ret = uv_fs_access(nullptr, &access_req, dest.c_str(), 0, nullptr); + int ret = uv_fs_access(nullptr, &access_req, dest.c_str(), 0, nullptr); uv_fs_req_cleanup(&access_req); if (ret == 0) { HILOGE("Failed to move file due to existing destPath with MODE_THROW_ERR."); diff --git a/interfaces/kits/js/src/mod_fs/properties/movedir_core.cpp b/interfaces/kits/js/src/mod_fs/properties/movedir_core.cpp index fb357ff05a3a69c00db190eb57a16472988fd709..f882c1aa2e45e191eaed247f4161cf1367612aa0 100644 --- a/interfaces/kits/js/src/mod_fs/properties/movedir_core.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/movedir_core.cpp @@ -226,10 +226,6 @@ static int MoveDirFunc(const string &src, const string &dest, const int mode, de if (found == std::string::npos) { return EINVAL; } - if (access(src.c_str(), W_OK) != 0) { - HILOGE("Failed to move src directory due to doesn't exist or hasn't write permission"); - return errno; - } string dirName = string(src).substr(found); string destStr = dest + dirName; auto [destStrExist, destStrEmpty] = JudgeExistAndEmpty(destStr);