1e41f4b71Sopenharmony_ci# File Management Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.filemanagement.1 environment Module Change 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciThe file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **environment** module supports error code processing. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci**Change Impact** 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ciIf your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **environment** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci**Key API/Component Changes** 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ciBefore the change, **environment** is imported from **@ohos.environment**: 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci```js 16e41f4b71Sopenharmony_ciimport environment from '@ohos.environment'; 17e41f4b71Sopenharmony_ci``` 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ciNow, **environment** is imported from **@ohos.file.environment**: 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci```js 22e41f4b71Sopenharmony_ciimport environment from '@ohos.file.environment'; 23e41f4b71Sopenharmony_ci``` 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci## cl.filemanagement.2 securityLabel Change 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ciMoved the file management subsystem **d.ts** file to the **file** directory. The **securityLabel** module supports error code processing. 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci**Change Impact** 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ciIf your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **securityLabel** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci**Key API/Component Changes** 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ciBefore the change, **securityLabel** is imported from **@ohos.securityLabel**: 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci```js 38e41f4b71Sopenharmony_ciimport securityLabel from '@ohos.securityLabel'; 39e41f4b71Sopenharmony_ci``` 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ciNow, **securityLabel** is imported from **@ohos.file.securityLabel**: 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci```js 44e41f4b71Sopenharmony_ciimport securityLabel from '@ohos.file.securityLabel'; 45e41f4b71Sopenharmony_ci``` 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ci## cl.filemanagement.3 fs Change 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ciChanged the **ino** attribute type of **Stat** under **fs**. 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci**Change Impact** 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ciThe **ino** attribute type is changed from number to BigInt, to adapt to the **inode** range of all types of files in the file system. 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci**Key API/Component Changes** 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ciThe type of the **ino** attribute of **Stat** is changed from number to BigInt. 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ci## cl.filemanagement.4 fileAccess Change 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ciMoved the file management subsystem **d.ts** file to the **file** directory. The **fileAccess** module supports error code processing. 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci**Change Impact** 64e41f4b71Sopenharmony_ci 65e41f4b71Sopenharmony_ciIf your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **fileAccess** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ci**Key API/Component Changes** 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_ciBefore the change, **fileAccess** is imported from **@ohos.data.fileAccess**: 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_ci```js 72e41f4b71Sopenharmony_ciimport fileAccess from '@ohos.data.fileAccess'; 73e41f4b71Sopenharmony_ci``` 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ciNow, **fileAccess** is imported from **@ohos.file.fileAccess**: 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci```js 78e41f4b71Sopenharmony_ciimport fileAccess from '@ohos.file.fileAccess'; 79e41f4b71Sopenharmony_ci``` 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ci## cl.filemanagement.5 fileExtensionInfo Change 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ciMoved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code processing. 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci**Change Impact** 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ciIf your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **fileExtensionInfo** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ci**Key API/Component Changes** 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ciBefore the change, **fileExtensionInfo** is imported from **@ohos.fileExtensionInfo**: 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci```js 94e41f4b71Sopenharmony_ciimport fileExtensionInfo from '@ohos.fileExtensionInfo'; 95e41f4b71Sopenharmony_ci``` 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ciNow, **fileExtensionInfo** is imported from **@ohos.file.fileExtensionInfo**: 98e41f4b71Sopenharmony_ci 99e41f4b71Sopenharmony_ci```js 100e41f4b71Sopenharmony_ciimport fileExtensionInfo from '@ohos.file.fileExtensionInfo'; 101e41f4b71Sopenharmony_ci``` 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ci## cl.filemanagement.6 storageStatistics Change 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ciMoved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code processing. 106e41f4b71Sopenharmony_ci 107e41f4b71Sopenharmony_ci**Change Impact** 108e41f4b71Sopenharmony_ci 109e41f4b71Sopenharmony_ciIf your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **storageStatistics** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 110e41f4b71Sopenharmony_ci 111e41f4b71Sopenharmony_ci**Key API/Component Changes** 112e41f4b71Sopenharmony_ci 113e41f4b71Sopenharmony_ciBefore the change, **storageStatistics** was imported from **@ohos.storageStatistics**: 114e41f4b71Sopenharmony_ci 115e41f4b71Sopenharmony_ci```js 116e41f4b71Sopenharmony_ciimport storageStatistics from '@ohos.storageStatistics'; 117e41f4b71Sopenharmony_ci``` 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ciNow, **storageStatistics** is imported from **@ohos.file.storageStatistics**: 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ci```js 122e41f4b71Sopenharmony_ciimport storageStatistics from '@ohos.file.storageStatistics'; 123e41f4b71Sopenharmony_ci``` 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci## cl.filemanagement.7 volumeManager Change 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ciMoved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code processing. 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci**Change Impact** 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ciIf your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **volumeManager** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci**Key API/Component Changes** 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ciBefore the change, **volumeManager** was imported from **@ohos.volumeManager**: 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci```js 138e41f4b71Sopenharmony_ciimport volumeManager from '@ohos.volumeManager'; 139e41f4b71Sopenharmony_ci``` 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_ciNow, **volumeManager** is imported from **@ohos.file.volumeManager**: 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ci```js 144e41f4b71Sopenharmony_ciimport volumeManager from '@ohos.file.volumeManager'; 145e41f4b71Sopenharmony_ci``` 146e41f4b71Sopenharmony_ci 147e41f4b71Sopenharmony_ci## cl.filemanagement.8 fileio API Changes 148e41f4b71Sopenharmony_ci 149e41f4b71Sopenharmony_ciDeprecated the **fileio** APIs, which do not return error codes; added APIs that return error codes. 150e41f4b71Sopenharmony_ci 151e41f4b71Sopenharmony_ci**Change Impact** 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ciFor applications developed based on earlier versions, pay attention to the iterative update of deprecated APIs. The specifications of the new APIs are slightly adjusted. Pay attention to the usage of the new APIs. 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ci**Key API/Component Changes** 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ciThe APIs of **@ohos.fileio** do not support error code handling and are deprecated. New APIs with minor changes in parameters are added in **@ohos.file.fs** to support unified error code handling specifications. The new APIs function the same as the original APIs. The following table lists the API changes. 158e41f4b71Sopenharmony_ciThe API names remain unchanged. 159e41f4b71Sopenharmony_ci 160e41f4b71Sopenharmony_ci| Module | Method/Attribute/Enum/Constant | Change Type| 161e41f4b71Sopenharmony_ci| ------------------------- | ------------------------------------------------------------ | -------- | 162e41f4b71Sopenharmony_ci| @ohos.fileio | **function** access(path: string, mode?: number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Deprecated | 163e41f4b71Sopenharmony_ci| @ohos.fileio | **function** accessSync(path: string, mode?: number): void | Deprecated | 164e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** access(path: string, callback?: AsyncCallback\<boolean>): void \| Promise\<boolean> | Added | 165e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** accessSync(path: string): boolean | Added | 166e41f4b71Sopenharmony_ci| @ohos.fileio | **function** close(fd: number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Deprecated | 167e41f4b71Sopenharmony_ci| @ohos.fileio | **function** closeSync(fd: number): void | Deprecated | 168e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** close(file: File \| number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Added | 169e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** closeSync(file: File \| number): void | Added | 170e41f4b71Sopenharmony_ci| @ohos.fileio | **function** mkdir(path: string, mode?: number, callback?: AsyncCallback\<void>): void \| Promise\<void> | Deprecated | 171e41f4b71Sopenharmony_ci| @ohos.fileio | **function** mkdirSync(path: string, mode?: number): void | Deprecated | 172e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** mkdir(path: string, callback?: AsyncCallback\<void>): void \| Promise\<void> | Added | 173e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** mkdirSync(path: string): void | Added | 174e41f4b71Sopenharmony_ci| @ohos.fileio | **function** readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\<string>): void \| Promise\<string> | Deprecated | 175e41f4b71Sopenharmony_ci| @ohos.fileio | **function** readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string | Deprecated | 176e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** readText(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\<string>): void \| Promise\<string> | Added | 177e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** readTextSync(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }): string | Added | 178e41f4b71Sopenharmony_ci| @ohos.fileio | **function** Stream.read(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback\<ReadOut>): void \| Promise\<ReadOut> | Deprecated | 179e41f4b71Sopenharmony_ci| @ohos.fileio | **function** Stream.readSync(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number | Deprecated | 180e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** Stream.read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback\<number>): void \| Promise\<number> | Added | 181e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** Stream.readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number | Added | 182e41f4b71Sopenharmony_ci| @ohos.fileio | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback\<number>): void \| Promise\<void> | Deprecated | 183e41f4b71Sopenharmony_ci| @ohos.fileio | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number | Deprecated | 184e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\<number>): void \| Promise\<void> | Added | 185e41f4b71Sopenharmony_ci| @ohos.file.fs | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }): number | Added | 186e41f4b71Sopenharmony_ci 187e41f4b71Sopenharmony_ci**Adaptation Guide** 188e41f4b71Sopenharmony_ci 189e41f4b71Sopenharmony_ciThe APIs of @ohos.file.fs support unified exception handling. For details, see [File Management](../../../application-dev/reference/apis/js-apis-file-fs.md). 190