harmony 鸿蒙Environment
Environment
Overview
Provides the capability of obtaining the root directory of user files.
Since: 12
Summary
Files
Name | Description |
---|---|
oh_environment.h | Defines the native APIs used to obtain the sandbox paths of the user files. |
Functions
Name | Description |
---|---|
FileManagement_ErrCode OH_Environment_GetUserDownloadDir (char **result) | Obtains the sandbox path of the Download root directory. Only 2-in-1 devices are supported. |
FileManagement_ErrCode OH_Environment_GetUserDesktopDir (char **result) | Obtains the sandbox path of the Desktop root directory. Only 2-in-1 devices are supported. |
FileManagement_ErrCode OH_Environment_GetUserDocumentDir (char **result) | Obtains the sandbox path of the Document root directory. Only 2-in-1 devices are supported. |
Function Description
OH_Environment_GetUserDesktopDir()
FileManagement_ErrCode OH_Environment_GetUserDesktopDir (char ** result)
Description Obtains the sandbox path of the Desktop root directory.
Since: 12
Parameters
Name | Description |
---|---|
result | Double pointer to the sandbox path of the Desktop root directory obtained. You also need to include malloc.h and use free() to release the memory allocated. |
Required permissions
ohos.permission.READ_WRITE_DESKTOP_DIRECTORY
Return value
OH_Environment_GetUserDocumentDir()
FileManagement_ErrCode OH_Environment_GetUserDocumentDir (char ** result)
Description Obtains the sandbox path of the Document root directory.
Since: 12
Parameters
Name | Description |
---|---|
result | Double pointer to the sandbox path of the Document root directory obtained. You also need to include malloc.h and use free() to release the memory allocated. |
Required permissions
ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY
Return value
OH_Environment_GetUserDownloadDir()
FileManagement_ErrCode OH_Environment_GetUserDownloadDir (char ** result)
Description Obtains the sandbox path of the Download root directory.
Since: 12
Parameters
Name | Description |
---|---|
result | Double pointer to the path of the Download root directory obtained. You also need to include malloc.h and use free() to release the memory allocated. |
Required permissions
ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY
Return value
你可能感兴趣的鸿蒙文章
harmony 鸿蒙FileShare_PolicyErrorResult
harmony 鸿蒙FileShare_PolicyInfo
harmony 鸿蒙File Management Error Codes
harmony 鸿蒙@ohos.application.BackupExtensionAbility (BackupExtensionAbility)
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦