• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.file.fileExtensionInfo (User File Extension Information) (System API)
2<!--Kit: Core File Kit-->
3<!--Subsystem: FileManagement-->
4<!--Owner: @wang_zhangjun; @zhuangzhuang-->
5<!--Designer: @wang_zhangjun; @zhuangzhuang; @renguang1116-->
6<!--Tester: @liuhonggang123; @yue-ye2; @juxiaopang-->
7<!--Adviser: @foryourself-->
8
9The **fileExtensionInfo** module defines attributes in **RootInfo** and **FileInfo** of the user file access and management module.
10
11>**NOTE**
12>
13>- The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
14>- The APIs provided by this module are system APIs.
15
16## Modules to Import
17
18```ts
19import fileExtensionInfo from '@ohos.file.fileExtensionInfo';
20```
21
22## fileExtensionInfo.DeviceType
23
24Defines the values of **deviceType** used in **RootInfo**.
25
26**Model restriction**: This API can be used only in the stage model.
27
28**System capability**: SystemCapability.FileManagement.UserFileService
29
30| Name| Value| Description|
31| ----- | ------ | ------ |
32| DEVICE_LOCAL_DISK | 1 | Local disk.|
33| DEVICE_SHARED_DISK | 2 | Shared disk.|
34| DEVICE_SHARED_TERMINAL | 3 | Distributed network device.|
35| DEVICE_NETWORK_NEIGHBORHOODS | 4 | Network neighbor device.|
36| DEVICE_EXTERNAL_MTP | 5 | MTP device.|
37| DEVICE_EXTERNAL_USB | 6 | USB device.|
38| DEVICE_EXTERNAL_CLOUD | 7 | Cloud disk.|
39
40## fileExtensionInfo.DeviceFlag
41
42Defines the values of **deviceFlags** used in **RootInfo**. **deviceFlags** is used to determine whether a capability is available through the AND operation.
43
44**Model restriction**: This API can be used only in the stage model.
45
46**System capability**: SystemCapability.FileManagement.UserFileService
47
48### Constants
49
50  | Name|   Type  | Value| Description    |
51  | ------ | ---- | ---- | -------- |
52  | SUPPORTS_READ   | number | 0b1   | The device supports read.|
53  | SUPPORTS_WRITE   | number | 0b10   |  The device supports write.|
54
55## fileExtensionInfo.DocumentFlag
56
57Defines the values of **mode** used in **FileInfo**.
58
59**Model restriction**: This API can be used only in the stage model.
60
61**System capability**: SystemCapability.FileManagement.UserFileService
62
63### Constants
64
65  | Name|   Type  | Value| Description    |
66  | ------ | ---- | ---- | -------- |
67  | REPRESENTS_FILE   | number | 0b1   | File.|
68  | REPRESENTS_DIR   | number | 0b10  | Directory.|
69  | SUPPORTS_READ   | number | 0b100   | This file is readable.|
70  | SUPPORTS_WRITE   | number | 0b1000  | This file is writable.|
71
72