js-apis-fileExtensionInfo.md 2.1 KB
Newer Older
A
Annie_wang 已提交
1
# @ohos.file.fileExtensionInfo (User File Extension Information)
A
Annie_wang 已提交
2 3 4 5 6 7 8 9 10 11 12

The **fileExtensionInfo** module defines attributes in **RootInfo** and **FileInfo** of the user file access and management module.

>**NOTE**
>
>- 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.
>- The APIs provided by this module are system APIs.

## Modules to Import

```js
A
Annie_wang 已提交
13
import fileExtensionInfo from '@ohos.file.fileExtensionInfo';
A
Annie_wang 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
```

## fileExtensionInfo.DeviceType

Defines the values of **deviceType** used in **RootInfo**.

**System capability**: SystemCapability.FileManagement.UserFileService

| Name| Value| Description|
| ----- | ------ | ------ |
| DEVICE_LOCAL_DISK | 1 | Local disk.|
| DEVICE_SHARED_DISK | 2 | Shared disk.|
| DEVICE_SHARED_TERMINAL | 3 | Distributed network device.|
| DEVICE_NETWORK_NEIGHBORHOODS | 4 | Network neighbor device.|
| DEVICE_EXTERNAL_MTP | 5 | MTP device.|
| DEVICE_EXTERNAL_USB | 6 | USB device.|
| DEVICE_EXTERNAL_CLOUD | 7 | Cloud disk.|

## fileExtensionInfo.DeviceFlag

Defines the values of **deviceFlags** used in **RootInfo**. **deviceFlags** is used to determine whether a capability is available through the AND operation.

**System capability**: SystemCapability.FileManagement.UserFileService

### Attributes

A
Annie_wang 已提交
40 41 42
  | Name| Type  | Readable| Writable| Description    |
  | ------ | ------ | ---- | ---- | -------- |
  | SUPPORTS_READ   | number | Yes  | No  | The device supports read.|
A
Annie_wang 已提交
43
  | SUPPORTS_WRITE   | number | Yes  | No  | The device supports write.|
A
Annie_wang 已提交
44 45 46 47 48 49 50 51 52

## fileExtensionInfo.DocumentFlag

Defines the values of **mode** used in **FileInfo**.

**System capability**: SystemCapability.FileManagement.UserFileService

### Attributes

A
Annie_wang 已提交
53 54 55 56 57 58
  | Name| Type  | Readable| Writable| Description    |
  | ------ | ------ | ---- | ---- | -------- |
  | REPRESENTS_FILE   | number | Yes  | No  | File.|
  | REPRESENTS_DIR   | number | Yes  | No  | Directory.|
  | SUPPORTS_READ   | number | Yes  | No  | This file is readable.|
  | SUPPORTS_WRITE   | number | Yes  | No  | This file is writable.|