From 4f06fb6435ab6f6828ca969a2179eedf7a2f4077 Mon Sep 17 00:00:00 2001 From: zhangkaixiang Date: Mon, 14 Aug 2023 21:56:56 +0800 Subject: [PATCH] return realPath when accessing realPath Signed-off-by: zhangkaixiang --- interfaces/innerkits/native/file_uri/src/file_uri.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/interfaces/innerkits/native/file_uri/src/file_uri.cpp b/interfaces/innerkits/native/file_uri/src/file_uri.cpp index f48d6e3d2..abef75608 100644 --- a/interfaces/innerkits/native/file_uri/src/file_uri.cpp +++ b/interfaces/innerkits/native/file_uri/src/file_uri.cpp @@ -31,7 +31,6 @@ const std::string PATH_SHARE = "/data/storage/el2/share"; const std::string MODE_RW = "/rw/"; const std::string MODE_R = "/r/"; const std::string FILE_SCHEME_PREFIX = "file://"; -const std::string FILE_MANAGER_BASE_PATH = "/storage/Users/"; const std::string FILE_MANAGER_AUTHORITY = "docs"; const std::string MEDIA_AUTHORITY = "media"; string FileUri::GetName() @@ -68,7 +67,7 @@ string FileUri::GetRealPath() string bundleName = uri_.GetAuthority(); LOGD("GetRealPath decode path is %{private}s", sandboxPath.c_str()); if (bundleName == FILE_MANAGER_AUTHORITY && - access(FILE_MANAGER_BASE_PATH.c_str(), F_OK) == 0) { + access(realPath.c_str(), F_OK) == 0) { return realPath; } -- Gitee