oh_environment.h
Overview
Defines the native APIs used to obtain the sandbox paths of the user files.
Header file: <filemanagement/environment/oh_environment.h>
Library: libohenvironment.so
System capability: SystemCapability.FileManagement.File.Environment.FolderObtain
Since: 12
Related module: Environment
Summary
Functions
| Name | Description |
|---|---|
| FileManagement_ErrCode OH_Environment_GetUserDownloadDir(char **result) | Obtains the sandbox path of the Download root directory. |
| FileManagement_ErrCode OH_Environment_GetUserDesktopDir(char **result) | Obtains the sandbox path of the Desktop root directory. |
| FileManagement_ErrCode OH_Environment_GetUserDocumentDir(char **result) | Obtains the sandbox path of the Document root directory. |
Function Description
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 |
|---|---|
| char **result | Double pointer to the path of the Download root directory. You also need to include malloc.h and use free() to release the memory allocated. |
Returns
| Type | Description |
|---|---|
| FileManagement_ErrCode | Returns FileManagement_ErrCode. |
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 |
|---|---|
| char **result | Double pointer to the path of the Desktop root directory. You also need to include malloc.h and use free() to release the memory allocated. |
Returns
| Type | Description |
|---|---|
| FileManagement_ErrCode | Returns FileManagement_ErrCode. |
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 |
|---|---|
| char **result | Double pointer to the path of the Document root directory. You also need to include malloc.h and use free() to release the memory allocated. |
Returns
| Type | Description |
|---|---|
| FileManagement_ErrCode | Returns FileManagement_ErrCode. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 js-apis-file-environment-sys
openharmony 鸿蒙 js-apis-file-fs
openharmony 鸿蒙 capi-clouddisk-clouddisk-pathinfo
openharmony 鸿蒙 capi-clouddisk-clouddisk-changesresult
openharmony 鸿蒙 capi-clouddisk-clouddisk-syncfolder
openharmony 鸿蒙 js-apis-fileShare
openharmony 鸿蒙 js-apis-file-storage-statistics-sys