• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# oh_fileio.h
2
3## Overview
4
5Defines the native APIs for basic file operations.
6
7**File to include**: <filemanagement/fileio/oh_fileio.h>
8
9**Library**: libohfileio.so
10
11**System capability**: SystemCapability.FileManagement.File.FileIO
12
13**Since**: 12
14
15**Related module**: [FileIO](capi-fileio.md)
16
17## Summary
18
19### Enums
20
21| Name| typedef Keyword| Description|
22| -- | -- | -- |
23| [FileIO_FileLocation](#fileio_filelocation) | FileIO_FileLocation | Enumerates the file locations.|
24
25### Functions
26
27| Name| Description|
28| -- | -- |
29| [FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength,FileIO_FileLocation *location)](#oh_fileio_getfilelocation) | Obtains the location of a file.|
30
31## Enum Description
32
33### FileIO_FileLocation
34
35```
36enum FileIO_FileLocation
37```
38
39**Description**
40
41Enumerates the file locations.
42
43**Since**: 12
44
45| Enum Item| Description|
46| -- | -- |
47| LOCAL = 1 | The file is stored on the local device.|
48| CLOUD = 2 | The file is stored on the cloud.|
49| LOCAL_AND_CLOUD = 3 | The file is stored on the local device and cloud.|
50
51
52## Function Description
53
54### OH_FileIO_GetFileLocation()
55
56```
57FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength,FileIO_FileLocation *location)
58```
59
60**Description**
61
62Obtains the location of a file.
63
64**Since**: 12
65
66
67**Parameters**
68
69| Name| Description|
70| -- | -- |
71| char *uri | Pointer to the URI of the file.|
72| int uriLength | Length of the URI.|
73| [FileIO_FileLocation](capi-oh-fileio-h.md#fileio_filelocation) *location | Pointer to the location of the file obtained.|
74
75**Returns**
76
77| Type| Description|
78| -- | -- |
79| [FileManagement_ErrCode](capi-error-code-h.md#filemanagement_errcode) | Returns [FileManagement_ErrCode](capi-error-code-h.md#filemanagement_errcode).|
80