diff --git a/interfaces/kits/native/BUILD.gn b/interfaces/kits/native/BUILD.gn index ceeb70833828000cd4643c701ccf3d7126aaad47..e10d192ae3a173e01d6d54d22b7e50f83e2150c2 100644 --- a/interfaces/kits/native/BUILD.gn +++ b/interfaces/kits/native/BUILD.gn @@ -98,6 +98,8 @@ ohos_shared_library("fileio_native") { cfi_cross_dso = true debug = false } + include_dirs = [ "${file_api_path}/utils/common/include" ] + sources = [ "fileio/fileio_native.cpp" ] public_configs = [ ":fileio_config" ] diff --git a/interfaces/kits/native/fileio/fileio_native.cpp b/interfaces/kits/native/fileio/fileio_native.cpp index 8a040ddf8a76bd500bdf5aa7d5bf06de2de2ee34..0c3a7b3f12bec9e7439ed6830fe32fcb29eb5d2d 100644 --- a/interfaces/kits/native/fileio/fileio_native.cpp +++ b/interfaces/kits/native/fileio/fileio_native.cpp @@ -19,6 +19,7 @@ #include "file_uri.h" #include "filemgmt_libhilog.h" +#include "file_utils.h" using namespace OHOS; using namespace OHOS::FileManagement; @@ -47,7 +48,7 @@ namespace { int GetLocationFromPath(const std::string &path) { - std::unique_ptr value = std::make_unique(MAX_ATTR_NAME); + auto value = OHOS::FileManagement::CreateUniquePtr(MAX_ATTR_NAME); if (value == nullptr) { HILOGE("Failed to request heap memory"); return -ENOMEM;