From 3cd543fdd7e3686fb92d29101b8ba77825ae03a1 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Thu, 17 Apr 2025 14:24:44 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=88=A0=E9=99=A4export?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: I60d59516d549f27d39655b5e6d8ee46f4fd1f404 --- api/@ohos.file.fs.d.ts | 63 ------------------------------------------ 1 file changed, 63 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index eb6ddfa720..da178237da 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -57,69 +57,6 @@ export default fileIo; * @since 12 */ declare namespace fileIo { - export { access }; - export { accessSync }; - export { close }; - export { closeSync }; - export { copy }; - export { copyDir }; - export { copyDirSync }; - export { copyFile }; - export { copyFileSync }; - export { createRandomAccessFile }; - export { createRandomAccessFileSync }; - export { createStream }; - export { createStreamSync }; - export { createReadStream }; - export { createWriteStream }; - export { createWatcher }; - export { dup }; - export { fdatasync }; - export { fdatasyncSync }; - export { fdopenStream }; - export { fdopenStreamSync }; - export { fsync }; - export { fsyncSync }; - export { getxattr }; - export { getxattrSync }; - export { listFile }; - export { listFileSync }; - export { lseek }; - export { lstat }; - export { lstatSync }; - export { mkdir }; - export { mkdirSync }; - export { mkdtemp }; - export { mkdtempSync }; - export { moveDir }; - export { moveDirSync }; - export { moveFile }; - export { moveFileSync }; - export { open }; - export { openSync }; - export { read }; - export { readSync }; - export { readLines }; - export { readLinesSync }; - export { readText }; - export { readTextSync }; - export { rename }; - export { renameSync }; - export { rmdir }; - export { rmdirSync }; - export { setxattr }; - export { setxattrSync }; - export { stat }; - export { statSync }; - export { symlink }; - export { symlinkSync }; - export { truncate }; - export { truncateSync }; - export { unlink }; - export { unlinkSync }; - export { utimes }; - export { write }; - export { writeSync }; export { AccessModeType }; export { AccessFlagType }; export { File }; -- Gitee From eb72d8b5eb56e3cb6421b094cd1c8808db0004a4 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Thu, 17 Apr 2025 14:26:09 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=B0=86=E6=96=B9=E6=B3=95=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E5=88=B0namespace=20=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: Ief4c05cbc4fdecb3cd1a5523b1a5bd6fdf91ba40 --- api/@ohos.file.fs.d.ts | 12007 ++++++++++++++++++++------------------- 1 file changed, 6004 insertions(+), 6003 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index da178237da..d7eb6fe91e 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -318,6124 +318,6125 @@ declare namespace fileIo { */ const SYNC = 0o4010000; } -} + + /** + * Access file. + * + * @param { string } path - path. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Access file. + * + * @param { string } path - path. + * @returns { Promise } Returns the file is accessible or not in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Access file. + * + * @param { string } path - path. + * @returns { Promise } Returns the file is accessible or not in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Access file. + * + * @param { string } path - path. + * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - accessibility mode. + * @returns { Promise } Returns the file is accessible or not in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function access(path: string, mode?: AccessModeType): Promise; -/** - * Access file. - * - * @param { string } path - path. - * @returns { Promise } return Promise - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Access file. - * - * @param { string } path - path. - * @returns { Promise } Returns the file is accessible or not in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Access file. - * - * @param { string } path - path. - * @returns { Promise } Returns the file is accessible or not in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Access file. - * - * @param { string } path - path. - * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - accessibility mode. - * @returns { Promise } Returns the file is accessible or not in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function access(path: string, mode?: AccessModeType): Promise; + /** + * Access file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return the file is accessible or not. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Access file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return the file is accessible or not. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Access file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return the file is accessible or not. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function access(path: string, callback: AsyncCallback): void; -/** - * Access file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return the file is accessible or not. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Access file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return the file is accessible or not. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Access file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return the file is accessible or not. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function access(path: string, callback: AsyncCallback): void; + /** + * Access file. + * + * @param { string } path - file path that needs to be checked whether the calling process can access. + * @param { AccessModeType } mode - accessibility mode. + * @param { AccessFlagType } flag - accessibility flag. + * @returns { Promise } Returns the file is accessible or not in promise mode. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise; -/** - * Access file. - * - * @param { string } path - file path that needs to be checked whether the calling process can access. - * @param { AccessModeType } mode - accessibility mode. - * @param { AccessFlagType } flag - accessibility flag. - * @returns { Promise } Returns the file is accessible or not in promise mode. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise; + /** + * Access file with sync interface. + * + * @param { string } path - path. + * @returns { boolean } Returns the file is accessible or not. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Access file with sync interface. + * + * @param { string } path - path. + * @returns { boolean } Returns the file is accessible or not. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Access file with sync interface. + * + * @param { string } path - path. + * @returns { boolean } Returns the file is accessible or not. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * + * Access file with sync interface. + * + * @param { string } path - path. + * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - accessibility mode. + * @returns { boolean } Returns the file is accessible or not. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function accessSync(path: string, mode?: AccessModeType): boolean; -/** - * Access file with sync interface. - * - * @param { string } path - path. - * @returns { boolean } Returns the file is accessible or not. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Access file with sync interface. - * - * @param { string } path - path. - * @returns { boolean } Returns the file is accessible or not. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Access file with sync interface. - * - * @param { string } path - path. - * @returns { boolean } Returns the file is accessible or not. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * - * Access file with sync interface. - * - * @param { string } path - path. - * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - accessibility mode. - * @returns { boolean } Returns the file is accessible or not. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function accessSync(path: string, mode?: AccessModeType): boolean; + /** + * Access file with sync interface. + * + * @param { string } path - file path that needs to be checked whether the calling process can access. + * @param { AccessModeType } mode - accessibility mode. + * @param { AccessFlagType } flag - accessibility flag. + * @returns { boolean } Returns the file is accessible or not. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean; -/** - * Access file with sync interface. - * - * @param { string } path - file path that needs to be checked whether the calling process can access. - * @param { AccessModeType } mode - accessibility mode. - * @param { AccessFlagType } flag - accessibility flag. - * @returns { boolean } Returns the file is accessible or not. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean; + /** + * Close file or fd. + * + * @param { number | File } file - file object or fd. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Close file or fd. + * + * @param { number | File } file - file object or fd. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Close file or fd. + * + * @param { number | File } file - file object or fd. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function close(file: number | File): Promise; -/** - * Close file or fd. - * - * @param { number | File } file - file object or fd. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Close file or fd. - * - * @param { number | File } file - file object or fd. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Close file or fd. - * - * @param { number | File } file - file object or fd. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function close(file: number | File): Promise; + /** + * Close file or fd. + * + * @param { number | File } file - file object or fd. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Close file or fd. + * + * @param { number | File } file - file object or fd. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Close file or fd. + * + * @param { number | File } file - file object or fd. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function close(file: number | File, callback: AsyncCallback): void; -/** - * Close file or fd. - * - * @param { number | File } file - file object or fd. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Close file or fd. - * - * @param { number | File } file - file object or fd. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Close file or fd. - * - * @param { number | File } file - file object or fd. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function close(file: number | File, callback: AsyncCallback): void; + /** + * Close file or fd with sync interface. + * + * @param { number | File } file - file object or fd. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Close file or fd with sync interface. + * + * @param { number | File } file - file object or fd. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Close file or fd with sync interface. + * + * @param { number | File } file - file object or fd. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function closeSync(file: number | File): void; -/** - * Close file or fd with sync interface. - * - * @param { number | File } file - file object or fd. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Close file or fd with sync interface. - * - * @param { number | File } file - file object or fd. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Close file or fd with sync interface. - * - * @param { number | File } file - file object or fd. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function closeSync(file: number | File): void; + /** + * Copy file or directory. + * + * @param { string } srcUri - src uri. + * @param { string } destUri - dest uri. + * @param { CopyOptions } [options] - options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied by the file system + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Copy file or directory. + * + * @param { string } srcUri - src uri. + * @param { string } destUri - dest uri. + * @param { CopyOptions } [options] - options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied by the file system + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise; -/** - * Copy file or directory. - * - * @param { string } srcUri - src uri. - * @param { string } destUri - dest uri. - * @param { CopyOptions } [options] - options. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied by the file system - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -/** - * Copy file or directory. - * - * @param { string } srcUri - src uri. - * @param { string } destUri - dest uri. - * @param { CopyOptions } [options] - options. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied by the file system - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise; - -/** - * Copy file or directory. - * - * @param { string } srcUri - src uri. - * @param { string } destUri - dest uri. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied by the file system - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare function copy(srcUri: string, destUri: string, callback: AsyncCallback): void; + /** + * Copy file or directory. + * + * @param { string } srcUri - src uri. + * @param { string } destUri - dest uri. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied by the file system + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + declare function copy(srcUri: string, destUri: string, callback: AsyncCallback): void; -/** - * Copy file or directory. - * - * @param { string } srcUri - src uri. - * @param { string } destUri - dest uri. - * @param { CopyOptions } options - options. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied by the file system - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback): void; + /** + * Copy file or directory. + * + * @param { string } srcUri - src uri. + * @param { string } destUri - dest uri. + * @param { CopyOptions } options - options. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied by the file system + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + declare function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback): void; -/** - * Copy directory. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { number } [mode = 0] - mode. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -/** - * Copy directory. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { number } [mode = 0] - mode. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function copyDir(src: string, dest: string, mode?: number): Promise; + /** + * Copy directory. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { number } [mode = 0] - mode. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Copy directory. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { number } [mode = 0] - mode. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function copyDir(src: string, dest: string, mode?: number): Promise; -/** - * Copy directory. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function copyDir(src: string, dest: string, callback: AsyncCallback): void; + /** + * Copy directory. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function copyDir(src: string, dest: string, callback: AsyncCallback): void; -/** - * Copy directory. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { AsyncCallback> } callback - Return the callback function. - * @throws { BusinessError } 13900015 - File exists - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function copyDir(src: string, dest: string, callback: AsyncCallback>): void; + /** + * Copy directory. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { AsyncCallback> } callback - Return the callback function. + * @throws { BusinessError } 13900015 - File exists + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function copyDir(src: string, dest: string, callback: AsyncCallback>): void; -/** - * Copy directory. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { number } mode - mode. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; + /** + * Copy directory. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { number } mode - mode. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; -/** - * Copy directory. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { number } mode - mode. - * @param { AsyncCallback> } callback - Return the callback function. - * @throws { BusinessError } 13900015 - File exists - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; + /** + * Copy directory. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { number } mode - mode. + * @param { AsyncCallback> } callback - Return the callback function. + * @throws { BusinessError } 13900015 - File exists + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; -/** - * Copy directory with sync interface. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { number } [mode = 0] - mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -/** - * Copy directory with sync interface. - * - * @param { string } src - source path. - * @param { string } dest - destination path. - * @param { number } [mode = 0] - mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function copyDirSync(src: string, dest: string, mode?: number): void; + /** + * Copy directory with sync interface. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { number } [mode = 0] - mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Copy directory with sync interface. + * + * @param { string } src - source path. + * @param { string } dest - destination path. + * @param { number } [mode = 0] - mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function copyDirSync(src: string, dest: string, mode?: number): void; -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function copyFile(src: string | number, dest: string | number, mode?: number): Promise; - -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function copyFile(src: string | number, dest: string | number, mode?: number): Promise; -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Copy file. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function copyFile( - src: string | number, - dest: string | number, - mode: number, - callback: AsyncCallback -): void; + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; -/** - * Copy file with sync interface. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Copy file with sync interface. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Copy file with sync interface. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Copy file with sync interface. - * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function copyFileSync(src: string | number, dest: string | number, mode?: number): void; + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function copyFile( + src: string | number, + dest: string | number, + mode: number, + callback: AsyncCallback + ): void; -/** - * Create class Stream. - * - * @param { string } path - path. - * @param { string } mode - mode. - * @returns { Promise } return Promise - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Create class Stream. - * - * @param { string } path - path. - * @param { string } mode - mode. - * @returns { Promise } return Promise - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function createStream(path: string, mode: string): Promise; + /** + * Copy file with sync interface. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Copy file with sync interface. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Copy file with sync interface. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Copy file with sync interface. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function copyFileSync(src: string | number, dest: string | number, mode?: number): void; -/** - * Create class Stream. - * - * @param { string } path - path. - * @param { string } mode - mode. - * @param { AsyncCallback } callback - callback. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function createStream(path: string, mode: string, callback: AsyncCallback): void; + /** + * Create class Stream. + * + * @param { string } path - path. + * @param { string } mode - mode. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Create class Stream. + * + * @param { string } path - path. + * @param { string } mode - mode. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function createStream(path: string, mode: string): Promise; -/** - * Create class Stream with sync interface. - * - * @param { string } path - path. - * @param { string } mode - mode. - * @returns { Stream } createStream - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Create class Stream with sync interface. - * - * @param { string } path - path. - * @param { string } mode - mode. - * @returns { Stream } createStream - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function createStreamSync(path: string, mode: string): Stream; + /** + * Create class Stream. + * + * @param { string } path - path. + * @param { string } mode - mode. + * @param { AsyncCallback } callback - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function createStream(path: string, mode: string, callback: AsyncCallback): void; + /** + * Create class Stream with sync interface. + * + * @param { string } path - path. + * @param { string } mode - mode. + * @returns { Stream } createStream + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Create class Stream with sync interface. + * + * @param { string } path - path. + * @param { string } mode - mode. + * @returns { Stream } createStream + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function createStreamSync(path: string, mode: string): Stream; -/** - * Create class RandomAccessFile. - * - * @param { string | File } file - file path, object. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { Promise } Returns the RandomAccessFile object which has been created in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -/** - * Create class RandomAccessFile. - * - * @param { string | File } file - file path, object. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @param { RandomAccessFileOptions } [options] - RandomAccessFile options - * @returns { Promise } Returns the RandomAccessFile object which has been created in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function createRandomAccessFile(file: string | File, mode?: number, - options?: RandomAccessFileOptions): Promise; -/** - * Create class RandomAccessFile. - * - * @param { string | File } file - file path, object. - * @param { AsyncCallback } callback - The callback is used to return the RandomAccessFile object which has been created. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function createRandomAccessFile(file: string | File, callback: AsyncCallback): void; + /** + * Create class RandomAccessFile. + * + * @param { string | File } file - file path, object. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { Promise } Returns the RandomAccessFile object which has been created in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Create class RandomAccessFile. + * + * @param { string | File } file - file path, object. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { RandomAccessFileOptions } [options] - RandomAccessFile options + * @returns { Promise } Returns the RandomAccessFile object which has been created in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function createRandomAccessFile(file: string | File, mode?: number, + options?: RandomAccessFileOptions): Promise; -/** - * Create class RandomAccessFile. - * - * @param { string | File } file - file path, object. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @param { AsyncCallback } callback - The callback is used to return the RandomAccessFile object which has been created. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback): void; + /** + * Create class RandomAccessFile. + * + * @param { string | File } file - file path, object. + * @param { AsyncCallback } callback - The callback is used to return the RandomAccessFile object which has been created. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function createRandomAccessFile(file: string | File, callback: AsyncCallback): void; -/** - * Create class RandomAccessFile with sync interface. - * - * @param { string | File } file - file path, object. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { RandomAccessFile } Returns the RandomAccessFile object which has been created. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -/** - * Create class RandomAccessFile with sync interface. - * - * @param { string | File } file - file path, object. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @param { RandomAccessFileOptions } [options] - RandomAccessFile options - * @returns { RandomAccessFile } Returns the RandomAccessFile object which has been created. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function createRandomAccessFileSync(file: string | File, mode?: number, - options?: RandomAccessFileOptions): RandomAccessFile; + /** + * Create class RandomAccessFile. + * + * @param { string | File } file - file path, object. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { AsyncCallback } callback - The callback is used to return the RandomAccessFile object which has been created. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback): void; -/** - * Create file read stream. - * - * @param { string } path - file path. - * @param { ReadStreamOptions } [options] - Optional parameters for ReadStream. - * @returns { ReadStream } Returns the ReadStream object which has been created. - * @throws { BusinessError } 401 - Parameter error - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; + /** + * Create class RandomAccessFile with sync interface. + * + * @param { string | File } file - file path, object. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { RandomAccessFile } Returns the RandomAccessFile object which has been created. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Create class RandomAccessFile with sync interface. + * + * @param { string | File } file - file path, object. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { RandomAccessFileOptions } [options] - RandomAccessFile options + * @returns { RandomAccessFile } Returns the RandomAccessFile object which has been created. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function createRandomAccessFileSync(file: string | File, mode?: number, + options?: RandomAccessFileOptions): RandomAccessFile; -/** - * Create file write stream. - * - * @param { string } path - file path. - * @param { WriteStreamOptions } [options] - Optional parameters for ReadStream. - * @returns { WriteStream } Returns the WriteStream object which has been created. - * @throws { BusinessError } 401 - Parameter error - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; + /** + * Create file read stream. + * + * @param { string } path - file path. + * @param { ReadStreamOptions } [options] - Optional parameters for ReadStream. + * @returns { ReadStream } Returns the ReadStream object which has been created. + * @throws { BusinessError } 401 - Parameter error + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; -/** - * Create watcher to listen for file changes. - * - * @param { string } path - path. - * @param { number } events - listened events. - * @param { WatchEventListener } listener - Callback to invoke when an event of the specified type occurs. - * @returns { Watcher } Returns the Watcher object which has been created. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; + /** + * Create file write stream. + * + * @param { string } path - file path. + * @param { WriteStreamOptions } [options] - Optional parameters for ReadStream. + * @returns { WriteStream } Returns the WriteStream object which has been created. + * @throws { BusinessError } 401 - Parameter error + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; -/** - * Duplicate fd to File Object. - * - * @param { number } fd - fd. - * @returns { File } return File - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function dup(fd: number): File; + /** + * Create watcher to listen for file changes. + * + * @param { string } path - path. + * @param { number } events - listened events. + * @param { WatchEventListener } listener - Callback to invoke when an event of the specified type occurs. + * @returns { Watcher } Returns the Watcher object which has been created. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; -/** - * Synchronize file metadata. - * - * @param { number } fd - fd. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Synchronize file metadata. - * - * @param { number } fd - fd. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function fdatasync(fd: number): Promise; + /** + * Duplicate fd to File Object. + * + * @param { number } fd - fd. + * @returns { File } return File + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function dup(fd: number): File; -/** - * Synchronize file metadata. - * - * @param { number } fd - fd. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Synchronize file metadata. - * - * @param { number } fd - fd. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function fdatasync(fd: number, callback: AsyncCallback): void; + /** + * Synchronize file metadata. + * + * @param { number } fd - fd. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Synchronize file metadata. + * + * @param { number } fd - fd. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function fdatasync(fd: number): Promise; -/** - * Synchronize file metadata with sync interface. - * - * @param { number } fd - fd. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Synchronize file metadata with sync interface. - * - * @param { number } fd - fd. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function fdatasyncSync(fd: number): void; + /** + * Synchronize file metadata. + * + * @param { number } fd - fd. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Synchronize file metadata. + * + * @param { number } fd - fd. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function fdatasync(fd: number, callback: AsyncCallback): void; -/** - * Create class Stream by using fd. - * - * @param { number } fd - fd. - * @param { string } mode - mode. - * @returns { Promise } Returns the Stream object in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function fdopenStream(fd: number, mode: string): Promise; + /** + * Synchronize file metadata with sync interface. + * + * @param { number } fd - fd. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Synchronize file metadata with sync interface. + * + * @param { number } fd - fd. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function fdatasyncSync(fd: number): void; -/** - * Create class Stream by using fd. - * - * @param { number } fd - fd. - * @param { string } mode - mode. - * @param { AsyncCallback } callback - The callback is used to return the Stream object. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; + /** + * Create class Stream by using fd. + * + * @param { number } fd - fd. + * @param { string } mode - mode. + * @returns { Promise } Returns the Stream object in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function fdopenStream(fd: number, mode: string): Promise; -/** - * Create class Stream by using fd with sync interface. - * - * @param { number } fd - fd. - * @param { string } mode - mode. - * @returns { Stream } Returns the Stream object. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function fdopenStreamSync(fd: number, mode: string): Stream; + /** + * Create class Stream by using fd. + * + * @param { number } fd - fd. + * @param { string } mode - mode. + * @param { AsyncCallback } callback - The callback is used to return the Stream object. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; -/** - * Synchronize file. - * - * @param { number } fd - fd. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Synchronize file. - * - * @param { number } fd - fd. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function fsync(fd: number): Promise; + /** + * Create class Stream by using fd with sync interface. + * + * @param { number } fd - fd. + * @param { string } mode - mode. + * @returns { Stream } Returns the Stream object. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function fdopenStreamSync(fd: number, mode: string): Stream; -/** - * Synchronize file. - * - * @param { number } fd - fd. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Synchronize file. - * - * @param { number } fd - fd. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function fsync(fd: number, callback: AsyncCallback): void; + /** + * Synchronize file. + * + * @param { number } fd - fd. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Synchronize file. + * + * @param { number } fd - fd. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function fsync(fd: number): Promise; -/** - * Synchronize file with sync interface. - * - * @param { number } fd - fd. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Synchronize file with sync interface. - * - * @param { number } fd - fd. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function fsyncSync(fd: number): void; + /** + * Synchronize file. + * + * @param { number } fd - fd. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Synchronize file. + * + * @param { number } fd - fd. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function fsync(fd: number, callback: AsyncCallback): void; -/** - * List file. - * - * @param { string } path - path. - * @param { object } [options] - options. - * @returns { Promise } Returns an Array containing the name of files or directories that meet the filter criteria in promise mode. - * If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * List file. - * - * @param { string } path - path. - * @param { object } [options] - options. - * @returns { Promise } Returns an Array containing the name of files or directories that meet the filter criteria. - * If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * List file. - * - * @param { string } path - path. - * @param { ListFileOptions } [options] - options. - * @returns { Promise } Returns an Array containing the name of files or directories that meet the filter criteria. - * If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function listFile( - path: string, - options?: ListFileOptions -): Promise; + /** + * Synchronize file with sync interface. + * + * @param { number } fd - fd. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Synchronize file with sync interface. + * + * @param { number } fd - fd. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function fsyncSync(fd: number): void; -/** - * List file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories - * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * List file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories - * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * List file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories - * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function listFile(path: string, callback: AsyncCallback): void; + /** + * List file. + * + * @param { string } path - path. + * @param { object } [options] - options. + * @returns { Promise } Returns an Array containing the name of files or directories that meet the filter criteria in promise mode. + * If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * List file. + * + * @param { string } path - path. + * @param { object } [options] - options. + * @returns { Promise } Returns an Array containing the name of files or directories that meet the filter criteria. + * If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * List file. + * + * @param { string } path - path. + * @param { ListFileOptions } [options] - options. + * @returns { Promise } Returns an Array containing the name of files or directories that meet the filter criteria. + * If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function listFile( + path: string, + options?: ListFileOptions + ): Promise; -/** - * List file. - * - * @param { string } path - path. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories - * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * List file. - * - * @param { string } path - path. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories - * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * List file. - * - * @param { string } path - path. - * @param { ListFileOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories - * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function listFile( - path: string, - options: ListFileOptions, - callback: AsyncCallback -): void; + /** + * List file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories + * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * List file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories + * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * List file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories + * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function listFile(path: string, callback: AsyncCallback): void; -/** - * List file with sync interface. - * - * @param { string } path - path. - * @param { object } [options] - options. - * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * List file with sync interface. - * - * @param { string } path - path. - * @param { object } [options] - options. - * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * List file with sync interface. - * - * @param { string } path - path. - * @param { ListFileOptions } [options] - options. - * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function listFileSync( - path: string, - options?: ListFileOptions -): string[]; + /** + * List file. + * + * @param { string } path - path. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories + * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * List file. + * + * @param { string } path - path. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories + * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * List file. + * + * @param { string } path - path. + * @param { ListFileOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return an Array containing the name of files or directories + * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function listFile( + path: string, + options: ListFileOptions, + callback: AsyncCallback + ): void; -/** - * Reposition file offset. - * - * @param { number } fd - file descriptor. - * @param { number } offset - file offset. - * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. - * @returns { number } Returns the file offset relative to starting position of file. - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900026 - Illegal seek - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -/** - * Reposition file offset. - * - * @param { number } fd - file descriptor. - * @param { number } offset - file offset. - * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. - * @returns { number } Returns the file offset relative to starting position of file. - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900026 - Illegal seek - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 12 - */ -declare function lseek(fd: number, offset: number, whence?: WhenceType): number; + /** + * List file with sync interface. + * + * @param { string } path - path. + * @param { object } [options] - options. + * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * List file with sync interface. + * + * @param { string } path - path. + * @param { object } [options] - options. + * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * List file with sync interface. + * + * @param { string } path - path. + * @param { ListFileOptions } [options] - options. + * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function listFileSync( + path: string, + options?: ListFileOptions + ): string[]; -/** - * Stat link file. - * - * @param { string } path - path. - * @returns { Promise } Returns the Stat object in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function lstat(path: string): Promise; + /** + * Reposition file offset. + * + * @param { number } fd - file descriptor. + * @param { number } offset - file offset. + * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. + * @returns { number } Returns the file offset relative to starting position of file. + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900026 - Illegal seek + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Reposition file offset. + * + * @param { number } fd - file descriptor. + * @param { number } offset - file offset. + * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. + * @returns { number } Returns the file offset relative to starting position of file. + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900026 - Illegal seek + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 12 + */ + declare function lseek(fd: number, offset: number, whence?: WhenceType): number; -/** - * Stat link file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function lstat(path: string, callback: AsyncCallback): void; + /** + * Stat link file. + * + * @param { string } path - path. + * @returns { Promise } Returns the Stat object in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function lstat(path: string): Promise; -/** - * Stat link file with sync interface. - * - * @param { string } path - path. - * @returns { Stat } Returns the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function lstatSync(path: string): Stat; + /** + * Stat link file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function lstat(path: string, callback: AsyncCallback): void; -/** - * Make dir. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Make dir. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Make dir. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function mkdir(path: string): Promise; + /** + * Stat link file with sync interface. + * + * @param { string } path - path. + * @returns { Stat } Returns the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function lstatSync(path: string): Stat; -/** - * Make dir. - * - * @param { string } path - path. - * @param { boolean } recursion - whether to recursively make directory. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 11 - */ -declare function mkdir(path: string, recursion: boolean): Promise; + /** + * Make dir. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Make dir. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Make dir. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function mkdir(path: string): Promise; -/** - * Make dir. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Make dir. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Make dir. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function mkdir(path: string, callback: AsyncCallback): void; + /** + * Make dir. + * + * @param { string } path - path. + * @param { boolean } recursion - whether to recursively make directory. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 11 + */ + declare function mkdir(path: string, recursion: boolean): Promise; -/** - * Make dir. - * - * @param { string } path - path. - * @param { boolean } recursion - whether to recursively make directory. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 11 - */ -declare function mkdir(path: string, recursion: boolean, callback: AsyncCallback): void; + /** + * Make dir. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Make dir. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Make dir. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function mkdir(path: string, callback: AsyncCallback): void; -/** - * Make dir with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Make dir with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Make dir with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function mkdirSync(path: string): void; + /** + * Make dir. + * + * @param { string } path - path. + * @param { boolean } recursion - whether to recursively make directory. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 11 + */ + declare function mkdir(path: string, recursion: boolean, callback: AsyncCallback): void; -/** - * Make dir with sync interface. - * - * @param { string } path - path. - * @param { boolean } recursion - whether to recursively make directory. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 11 - */ -declare function mkdirSync(path: string, recursion: boolean): void; + /** + * Make dir with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Make dir with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Make dir with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function mkdirSync(path: string): void; -/** - * Make temp dir. - * - * @param { string } prefix - dir prefix. - * @returns { Promise } Returns the path to the new directory in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Make temp dir. - * - * @param { string } prefix - dir prefix. - * @returns { Promise } Returns the path to the new directory in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function mkdtemp(prefix: string): Promise; + /** + * Make dir with sync interface. + * + * @param { string } path - path. + * @param { boolean } recursion - whether to recursively make directory. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 11 + */ + declare function mkdirSync(path: string, recursion: boolean): void; -/** - * Make temp dir. - * - * @param { string } prefix - dir prefix. - * @param { AsyncCallback } callback - The callback is used to return the path to the new directory. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Make temp dir. - * - * @param { string } prefix - dir prefix. - * @param { AsyncCallback } callback - The callback is used to return the path to the new directory. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function mkdtemp(prefix: string, callback: AsyncCallback): void; + /** + * Make temp dir. + * + * @param { string } prefix - dir prefix. + * @returns { Promise } Returns the path to the new directory in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Make temp dir. + * + * @param { string } prefix - dir prefix. + * @returns { Promise } Returns the path to the new directory in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function mkdtemp(prefix: string): Promise; + + /** + * Make temp dir. + * + * @param { string } prefix - dir prefix. + * @param { AsyncCallback } callback - The callback is used to return the path to the new directory. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Make temp dir. + * + * @param { string } prefix - dir prefix. + * @param { AsyncCallback } callback - The callback is used to return the path to the new directory. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function mkdtemp(prefix: string, callback: AsyncCallback): void; -/** - * Make temp dir with sync interface. - * - * @param { string } prefix - dir prefix. - * @returns { string } Returns the path to the new directory. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Make temp dir with sync interface. - * - * @param { string } prefix - dir prefix. - * @returns { string } Returns the path to the new directory. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function mkdtempSync(prefix: string): string; + /** + * Make temp dir with sync interface. + * + * @param { string } prefix - dir prefix. + * @returns { string } Returns the path to the new directory. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Make temp dir with sync interface. + * + * @param { string } prefix - dir prefix. + * @returns { string } Returns the path to the new directory. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function mkdtempSync(prefix: string): string; -/** - * Move directory. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function moveDir(src: string, dest: string, mode?: number): Promise; + /** + * Move directory. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function moveDir(src: string, dest: string, mode?: number): Promise; -/** - * Move directory. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function moveDir(src: string, dest: string, callback: AsyncCallback): void; + /** + * Move directory. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function moveDir(src: string, dest: string, callback: AsyncCallback): void; -/** - * Move directory. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { AsyncCallback> } callback - Return the callback function. - * @throws { BusinessError } 13900015 - File exists - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function moveDir(src: string, dest: string, callback: AsyncCallback>): void; + /** + * Move directory. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { AsyncCallback> } callback - Return the callback function. + * @throws { BusinessError } 13900015 - File exists + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function moveDir(src: string, dest: string, callback: AsyncCallback>): void; -/** - * Move directory. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } mode - move mode when duplicate file name exists. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; + /** + * Move directory. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } mode - move mode when duplicate file name exists. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; -/** - * Move directory. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } mode - move mode when duplicate file name exists. - * @param { AsyncCallback> } callback - Return the callback function. - * @throws { BusinessError } 13900015 - File exists - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; + /** + * Move directory. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } mode - move mode when duplicate file name exists. + * @param { AsyncCallback> } callback - Return the callback function. + * @throws { BusinessError } 13900015 - File exists + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; -/** - * Move directory with sync interface. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare function moveDirSync(src: string, dest: string, mode?: number): void; + /** + * Move directory with sync interface. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + declare function moveDirSync(src: string, dest: string, mode?: number): void; -/** - * Move file. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Move file. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function moveFile(src: string, dest: string, mode?: number): Promise; + /** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function moveFile(src: string, dest: string, mode?: number): Promise; -/** - * Move file. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Move file. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function moveFile(src: string, dest: string, callback: AsyncCallback): void; + /** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function moveFile(src: string, dest: string, callback: AsyncCallback): void; -/** - * Move file. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Move file. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; + /** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; -/** - * Move file with sync interface. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Move file with sync interface. - * - * @param { string } src - source file path. - * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -declare function moveFileSync(src: string, dest: string, mode?: number): void; + /** + * Move file with sync interface. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Move file with sync interface. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + declare function moveFileSync(src: string, dest: string, mode?: number): void; -/** - * Open file. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Open file. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Open file. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Open file. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function open(path: string, mode?: number): Promise; + /** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { Promise } Returns the File object in Promise mode to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function open(path: string, mode?: number): Promise; -/** - * Open file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Open file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Open file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function open(path: string, callback: AsyncCallback): void; + /** + * Open file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Open file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Open file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function open(path: string, callback: AsyncCallback): void; -/** - * Open file. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Open file. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Open file. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function open(path: string, mode: number, callback: AsyncCallback): void; + /** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { AsyncCallback } callback - The callback is used to return the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function open(path: string, mode: number, callback: AsyncCallback): void; -/** - * Open file with sync interface. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { File } Returns the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Open file with sync interface. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { File } Returns the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Open file with sync interface. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { File } Returns the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Open file with sync interface. - * - * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. - * @returns { File } Returns the File object to record the file descriptor. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function openSync(path: string, mode?: number): File; + /** + * Open file with sync interface. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { File } Returns the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Open file with sync interface. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { File } Returns the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Open file with sync interface. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { File } Returns the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Open file with sync interface. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { File } Returns the File object to record the file descriptor. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function openSync(path: string, mode?: number): File; -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function read( - fd: number, - buffer: ArrayBuffer, - options?: ReadOptions -): Promise; + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function read( + fd: number, + buffer: ArrayBuffer, + options?: ReadOptions + ): Promise; -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function read( - fd: number, - buffer: ArrayBuffer, - options: ReadOptions, - callback: AsyncCallback -): void; + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function read( + fd: number, + buffer: ArrayBuffer, + options: ReadOptions, + callback: AsyncCallback + ): void; -/** - * Read file with sync interface. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read file with sync interface. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read file with sync interface. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Read file with sync interface. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function readSync( - fd: number, - buffer: ArrayBuffer, - options?: ReadOptions -): number; + /** + * Read file with sync interface. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read file with sync interface. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read file with sync interface. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { number } Returns the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Read file with sync interface. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { number } Returns the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function readSync( + fd: number, + buffer: ArrayBuffer, + options?: ReadOptions + ): number; -/** - * Read content line by line. - * - * @param { string } filePath - file path. - * @param { Options } [options] - optional parameters - * @returns { Promise } Returns the iterator object in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -/** - * Read content line by line. - * - * @param { string } filePath - file path. - * @param { Options } [options] - optional parameters - * @returns { Promise } Returns the iterator object in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function readLines(filePath: string, options?: Options): Promise; + /** + * Read content line by line. + * + * @param { string } filePath - file path. + * @param { Options } [options] - optional parameters + * @returns { Promise } Returns the iterator object in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Read content line by line. + * + * @param { string } filePath - file path. + * @param { Options } [options] - optional parameters + * @returns { Promise } Returns the iterator object in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function readLines(filePath: string, options?: Options): Promise; -/** - * Read content line by line. - * - * @param { string } filePath - file path. - * @param { AsyncCallback } callback - The callback is used to return the iterator object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare function readLines(filePath: string, callback: AsyncCallback): void; + /** + * Read content line by line. + * + * @param { string } filePath - file path. + * @param { AsyncCallback } callback - The callback is used to return the iterator object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + declare function readLines(filePath: string, callback: AsyncCallback): void; -/** - * Read content line by line. - * - * @param { string } filePath - file path. - * @param { Options } options - optional parameters - * @param { AsyncCallback } callback - The callback is used to return the iterator object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare function readLines(filePath: string, options: Options, callback: AsyncCallback): void; + /** + * Read content line by line. + * + * @param { string } filePath - file path. + * @param { Options } options - optional parameters + * @param { AsyncCallback } callback - The callback is used to return the iterator object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + declare function readLines(filePath: string, options: Options, callback: AsyncCallback): void; -/** - * Read content line by line with sync interface. - * - * @param { string } filePath - file path. - * @param { Options } [options] - optional parameters - * @returns { ReaderIterator } Returns the iterator object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -/** - * Read content line by line with sync interface. - * - * @param { string } filePath - file path. - * @param { Options } [options] - optional parameters - * @returns { ReaderIterator } Returns the iterator object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function readLinesSync(filePath: string, options?: Options): ReaderIterator; + /** + * Read content line by line with sync interface. + * + * @param { string } filePath - file path. + * @param { Options } [options] - optional parameters + * @returns { ReaderIterator } Returns the iterator object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Read content line by line with sync interface. + * + * @param { string } filePath - file path. + * @param { Options } [options] - optional parameters + * @returns { ReaderIterator } Returns the iterator object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function readLinesSync(filePath: string, options?: Options): ReaderIterator; -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { object } [options] - options. - * @returns { Promise } Returns the contents of the read file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { object } [options] - options. - * @returns { Promise } Returns the contents of the read file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { ReadTextOptions } [options] - options. - * @returns { Promise } Returns the contents of the read file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { ReadTextOptions } [options] - options. - * @returns { Promise } Returns the contents of the read file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function readText( - filePath: string, - options?: ReadTextOptions -): Promise; + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { object } [options] - options. + * @returns { Promise } Returns the contents of the read file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { object } [options] - options. + * @returns { Promise } Returns the contents of the read file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { ReadTextOptions } [options] - options. + * @returns { Promise } Returns the contents of the read file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { ReadTextOptions } [options] - options. + * @returns { Promise } Returns the contents of the read file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function readText( + filePath: string, + options?: ReadTextOptions + ): Promise; -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function readText(filePath: string, callback: AsyncCallback): void; + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function readText(filePath: string, callback: AsyncCallback): void; -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read text. - * - * @param { string } filePath - file path. - * @param { ReadTextOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function readText( - filePath: string, - options: ReadTextOptions, - callback: AsyncCallback -): void; + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read text. + * + * @param { string } filePath - file path. + * @param { ReadTextOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function readText( + filePath: string, + options: ReadTextOptions, + callback: AsyncCallback + ): void; -/** - * Read text with sync interface. - * - * @param { string } filePath - file path. - * @param { object } [options] - options. - * @returns { string } Returns the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Read text with sync interface. - * - * @param { string } filePath - file path. - * @param { object } [options] - options. - * @returns { string } Returns the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Read text with sync interface. - * - * @param { string } filePath - file path. - * @param { ReadTextOptions } [options] - options. - * @returns { string } Returns the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -/** - * Read text with sync interface. - * - * @param { string } filePath - file path. - * @param { ReadTextOptions } [options] - options. - * @returns { string } Returns the contents of the read file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 12 - */ -declare function readTextSync( - filePath: string, - options?: ReadTextOptions -): string; + /** + * Read text with sync interface. + * + * @param { string } filePath - file path. + * @param { object } [options] - options. + * @returns { string } Returns the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read text with sync interface. + * + * @param { string } filePath - file path. + * @param { object } [options] - options. + * @returns { string } Returns the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Read text with sync interface. + * + * @param { string } filePath - file path. + * @param { ReadTextOptions } [options] - options. + * @returns { string } Returns the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Read text with sync interface. + * + * @param { string } filePath - file path. + * @param { ReadTextOptions } [options] - options. + * @returns { string } Returns the contents of the read file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 12 + */ + declare function readTextSync( + filePath: string, + options?: ReadTextOptions + ): string; -/** - * Rename file. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Rename file. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Rename file. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function rename(oldPath: string, newPath: string): Promise; + /** + * Rename file. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Rename file. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Rename file. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function rename(oldPath: string, newPath: string): Promise; -/** - * Rename file. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @param { AsyncCallback } callback - Returns the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Rename file. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @param { AsyncCallback } callback - Returns the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Rename file. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @param { AsyncCallback } callback - Returns the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; + /** + * Rename file. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @param { AsyncCallback } callback - Returns the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Rename file. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @param { AsyncCallback } callback - Returns the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Rename file. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @param { AsyncCallback } callback - Returns the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; -/** - * Rename file with sync interface. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Rename file with sync interface. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Rename file with sync interface. - * - * @param { string } oldPath - oldPath. - * @param { string } newPath - newPath. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900016 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function renameSync(oldPath: string, newPath: string): void; + /** + * Rename file with sync interface. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Rename file with sync interface. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Rename file with sync interface. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function renameSync(oldPath: string, newPath: string): void; -/** - * Delete dir. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Delete dir. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Delete dir. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function rmdir(path: string): Promise; + /** + * Delete dir. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Delete dir. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Delete dir. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function rmdir(path: string): Promise; -/** - * Delete dir. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Delete dir. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Delete dir. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function rmdir(path: string, callback: AsyncCallback): void; + /** + * Delete dir. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Delete dir. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Delete dir. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function rmdir(path: string, callback: AsyncCallback): void; + + /** + * Delete dir with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Delete dir with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Delete dir with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function rmdirSync(path: string): void; -/** - * Delete dir with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Delete dir with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Delete dir with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function rmdirSync(path: string): void; + /** + * Get file information. + * + * @param { string | number } file - path or file descriptor. + * @returns { Promise } Returns the Stat object in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Get file information. + * + * @param { string | number } file - path or file descriptor. + * @returns { Promise } Returns the Stat object in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Get file information. + * + * @param { string | number } file - path or file descriptor. + * @returns { Promise } Returns the Stat object in promise mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function stat(file: string | number): Promise; -/** - * Get file information. - * - * @param { string | number } file - path or file descriptor. - * @returns { Promise } Returns the Stat object in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Get file information. - * - * @param { string | number } file - path or file descriptor. - * @returns { Promise } Returns the Stat object in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Get file information. - * - * @param { string | number } file - path or file descriptor. - * @returns { Promise } Returns the Stat object in promise mode. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function stat(file: string | number): Promise; + /** + * Get file information. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } callback - The callback is used to return the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Get file information. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } callback - The callback is used to return the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Get file information. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } callback - The callback is used to return the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function stat(file: string | number, callback: AsyncCallback): void; -/** - * Get file information. - * - * @param { string | number } file - path or file descriptor. - * @param { AsyncCallback } callback - The callback is used to return the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Get file information. - * - * @param { string | number } file - path or file descriptor. - * @param { AsyncCallback } callback - The callback is used to return the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Get file information. - * - * @param { string | number } file - path or file descriptor. - * @param { AsyncCallback } callback - The callback is used to return the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function stat(file: string | number, callback: AsyncCallback): void; + /** + * Get file information with sync interface. + * + * @param { string | number } file - path or file descriptor. + * @returns { Stat } Returns the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Get file information with sync interface. + * + * @param { string | number } file - path or file descriptor. + * @returns { Stat } Returns the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Get file information with sync interface. + * + * @param { string | number } file - path or file descriptor. + * @returns { Stat } Returns the Stat object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function statSync(file: string | number): Stat; -/** - * Get file information with sync interface. - * - * @param { string | number } file - path or file descriptor. - * @returns { Stat } Returns the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Get file information with sync interface. - * - * @param { string | number } file - path or file descriptor. - * @returns { Stat } Returns the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Get file information with sync interface. - * - * @param { string | number } file - path or file descriptor. - * @returns { Stat } Returns the Stat object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function statSync(file: string | number): Stat; + /** + * Link file. + * + * @param { string } target - target. + * @param { string } srcPath - srcPath. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function symlink(target: string, srcPath: string): Promise; -/** - * Link file. - * - * @param { string } target - target. - * @param { string } srcPath - srcPath. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function symlink(target: string, srcPath: string): Promise; + /** + * Link file. + * + * @param { string } target - target. + * @param { string } srcPath - srcPath. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function symlink(target: string, srcPath: string, callback: AsyncCallback): void; -/** - * Link file. - * - * @param { string } target - target. - * @param { string } srcPath - srcPath. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function symlink(target: string, srcPath: string, callback: AsyncCallback): void; + /** + * Link file with sync interface. + * + * @param { string } target - target. + * @param { string } srcPath - srcPath. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + declare function symlinkSync(target: string, srcPath: string): void; -/** - * Link file with sync interface. - * - * @param { string } target - target. - * @param { string } srcPath - srcPath. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare function symlinkSync(target: string, srcPath: string): void; + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function truncate(file: string | number, len?: number): Promise; -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function truncate(file: string | number, len?: number): Promise; + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function truncate(file: string | number, callback: AsyncCallback): void; -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function truncate(file: string | number, callback: AsyncCallback): void; + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function truncate(file: string | number, len: number, callback: AsyncCallback): void; -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Truncate file. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function truncate(file: string | number, len: number, callback: AsyncCallback): void; + /** + * Truncate file with sync interface. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Truncate file with sync interface. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Truncate file with sync interface. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function truncateSync(file: string | number, len?: number): void; -/** - * Truncate file with sync interface. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Truncate file with sync interface. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Truncate file with sync interface. - * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function truncateSync(file: string | number, len?: number): void; + /** + * Delete file. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Delete file. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Delete file. + * + * @param { string } path - path. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function unlink(path: string): Promise; -/** - * Delete file. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Delete file. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Delete file. - * - * @param { string } path - path. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function unlink(path: string): Promise; + /** + * Delete file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Delete file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Delete file. + * + * @param { string } path - path. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function unlink(path: string, callback: AsyncCallback): void; -/** - * Delete file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Delete file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Delete file. - * - * @param { string } path - path. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function unlink(path: string, callback: AsyncCallback): void; + /** + * Delete file with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Delete file with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Delete file with sync interface. + * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function unlinkSync(path: string): void; -/** - * Delete file with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Delete file with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Delete file with sync interface. - * - * @param { string } path - path. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function unlinkSync(path: string): void; + /** + * Change file mtime. + * + * @param { string } path - path. + * @param { number } mtime - last modification time + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Change file mtime. + * + * @param { string } path - path. + * @param { number } mtime - last modification time + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 12 + */ + declare function utimes(path: string, mtime: number): void; -/** - * Change file mtime. - * - * @param { string } path - path. - * @param { number } mtime - last modification time - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -/** - * Change file mtime. - * - * @param { string } path - path. - * @param { number } mtime - last modification time - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 12 - */ -declare function utimes(path: string, mtime: number): void; + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of bytes written to the file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of bytes written to the file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @returns { Promise } Returns the number of bytes written to the file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function write( + fd: number, + buffer: ArrayBuffer | string, + options?: WriteOptions + ): Promise; -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of bytes written to the file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of bytes written to the file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @returns { Promise } Returns the number of bytes written to the file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function write( - fd: number, - buffer: ArrayBuffer | string, - options?: WriteOptions -): Promise; + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function write( + fd: number, + buffer: ArrayBuffer | string, + options: WriteOptions, + callback: AsyncCallback + ): void; -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Write file. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function write( - fd: number, - buffer: ArrayBuffer | string, - options: WriteOptions, - callback: AsyncCallback -): void; + /** + * Write file with sync interface. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Write file with sync interface. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Write file with sync interface. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @returns { number } Returns the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + declare function writeSync( + fd: number, + buffer: ArrayBuffer | string, + options?: WriteOptions + ): number; -/** - * Write file with sync interface. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Write file with sync interface. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Write file with sync interface. - * - * @param { number } fd - file descriptor. - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @returns { number } Returns the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare function writeSync( - fd: number, - buffer: ArrayBuffer | string, - options?: WriteOptions -): number; + /** + * Connect Distributed File System. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { string } networkId - The networkId of device. + * @param { DfsListeners } listeners - The listeners of Distributed File System. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900045 - Connection failed. + * @throws { BusinessError } 13900046 - Software caused connection abort. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function connectDfs(networkId: string, listeners: DfsListeners): Promise; -/** - * Connect Distributed File System. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param { string } networkId - The networkId of device. - * @param { DfsListeners } listeners - The listeners of Distributed File System. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900045 - Connection failed. - * @throws { BusinessError } 13900046 - Software caused connection abort. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function connectDfs(networkId: string, listeners: DfsListeners): Promise; + /** + * Disconnect Distributed File System. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { string } networkId - The networkId of device. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600004 - Unmount failed. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function disconnectDfs(networkId: string): Promise; -/** - * Disconnect Distributed File System. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param { string } networkId - The networkId of device. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13600004 - Unmount failed. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function disconnectDfs(networkId: string): Promise; + /** + * Set extended attributes information of the file. + * + * @param { string } path - path. + * @param { string } key - the key of extended attribute. + * @param { string } value - the value of extended attribute. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function setxattr(path: string, key: string, value: string): Promise; -/** - * Set extended attributes information of the file. - * - * @param { string } path - path. - * @param { string } key - the key of extended attribute. - * @param { string } value - the value of extended attribute. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function setxattr(path: string, key: string, value: string): Promise; + /** + * Set extended attributes information of the file. + * + * @param { string } path - path. + * @param { string } key - the key of extended attribute. + * @param { string } value - the value of extended attribute. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ -/** - * Set extended attributes information of the file. - * - * @param { string } path - path. - * @param { string } key - the key of extended attribute. - * @param { string } value - the value of extended attribute. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ + declare function setxattrSync(path: string, key: string, value: string): void; -declare function setxattrSync(path: string, key: string, value: string): void; + /** + * Get extended attributes information of the file. + * + * @param { string } path - path. + * @param { string } key - the key of extended attribute. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function getxattr(path: string, key: string): Promise; -/** - * Get extended attributes information of the file. - * - * @param { string } path - path. - * @param { string } key - the key of extended attribute. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900007 - Arg list too long - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function getxattr(path: string, key: string): Promise; + /** + * Get extended attributes information of the file with sync interface. + * + * @param { string } path - path. + * @param { string } key - the key of extended attribute. + * @returns { string } Return the value of extended attribute. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + declare function getxattrSync(path: string, key: string): string; +} -/** - * Get extended attributes information of the file with sync interface. - * - * @param { string } path - path. - * @param { string } key - the key of extended attribute. - * @returns { string } Return the value of extended attribute. - * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900007 - Arg list too long - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare function getxattrSync(path: string, key: string): string; /** * Progress data of copyFile -- Gitee From b21febdb664ef2dee5371772dd783229d44f8998 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Thu, 17 Apr 2025 14:32:47 +0800 Subject: [PATCH 3/9] =?UTF-8?q?function=20=E6=89=93=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: I58286c386135f52a0c558169315a79b16f28e04c --- api/@ohos.file.fs.d.ts | 603 +++++++++++++++++++++++++---------------- 1 file changed, 363 insertions(+), 240 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index d7eb6fe91e..922591d0f4 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -100,7 +100,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ namespace OpenMode { /** @@ -125,7 +126,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ const READ_ONLY = 0o0; /** @@ -150,7 +152,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ const WRITE_ONLY = 0o1; /** @@ -175,7 +178,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ const READ_WRITE = 0o2; /** @@ -200,7 +204,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ const CREATE = 0o100; /** @@ -225,7 +230,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ const TRUNC = 0o1000; /** @@ -250,7 +256,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ const APPEND = 0o2000; /** @@ -266,7 +273,8 @@ declare namespace fileIo { * @constant * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ const NONBLOCK = 0o4000; /** @@ -282,7 +290,8 @@ declare namespace fileIo { * @constant * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ const DIR = 0o200000; /** @@ -314,11 +323,12 @@ declare namespace fileIo { * @constant * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ const SYNC = 0o4010000; } - + /** * Access file. * @@ -403,9 +413,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function access(path: string, mode?: AccessModeType): Promise; + export function access(path: string, mode?: AccessModeType): Promise; /** * Access file. @@ -468,9 +479,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function access(path: string, callback: AsyncCallback): void; + export function access(path: string, callback: AsyncCallback): void; /** * Access file. @@ -491,9 +503,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900030 - File name too long * @throws { BusinessError } 13900033 - Too many symbolic links encountered * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise; + export function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise; /** * Access file with sync interface. @@ -580,9 +593,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function accessSync(path: string, mode?: AccessModeType): boolean; + export function accessSync(path: string, mode?: AccessModeType): boolean; /** * Access file with sync interface. @@ -603,9 +617,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900030 - File name too long * @throws { BusinessError } 13900033 - Too many symbolic links encountered * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean; + export function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean; /** * Close file or fd. @@ -650,9 +665,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function close(file: number | File): Promise; + export function close(file: number | File): Promise; /** * Close file or fd. @@ -697,9 +713,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function close(file: number | File, callback: AsyncCallback): void; + export function close(file: number | File, callback: AsyncCallback): void; /** * Close file or fd with sync interface. @@ -741,9 +758,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function closeSync(file: number | File): void; + export function closeSync(file: number | File): void; /** * Copy file or directory. @@ -816,9 +834,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise; + export function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise; /** * Copy file or directory. @@ -853,9 +872,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copy(srcUri: string, destUri: string, callback: AsyncCallback): void; + export function copy(srcUri: string, destUri: string, callback: AsyncCallback): void; /** * Copy file or directory. @@ -891,9 +911,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback): void; + export function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback): void; /** * Copy directory. @@ -948,9 +969,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyDir(src: string, dest: string, mode?: number): Promise; + export function copyDir(src: string, dest: string, mode?: number): Promise; /** * Copy directory. @@ -976,9 +998,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900038 - Value too large for defined data type * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyDir(src: string, dest: string, callback: AsyncCallback): void; + export function copyDir(src: string, dest: string, callback: AsyncCallback): void; /** * Copy directory. @@ -988,9 +1011,10 @@ declare namespace fileIo { * @param { AsyncCallback> } callback - Return the callback function. * @throws { BusinessError } 13900015 - File exists * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyDir(src: string, dest: string, callback: AsyncCallback>): void; + export function copyDir(src: string, dest: string, callback: AsyncCallback>): void; /** @@ -1018,9 +1042,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900038 - Value too large for defined data type * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; + export function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; /** * Copy directory. @@ -1031,9 +1056,10 @@ declare namespace fileIo { * @param { AsyncCallback> } callback - Return the callback function. * @throws { BusinessError } 13900015 - File exists * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; + export function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; /** * Copy directory with sync interface. @@ -1088,9 +1114,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyDirSync(src: string, dest: string, mode?: number): void; + export function copyDirSync(src: string, dest: string, mode?: number): void; /** * Copy file. @@ -1204,9 +1231,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyFile(src: string | number, dest: string | number, mode?: number): Promise; + export function copyFile(src: string | number, dest: string | number, mode?: number): Promise; /** * Copy file. @@ -1287,9 +1315,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; + export function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; /** * Copy file. @@ -1373,9 +1402,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyFile( + export function copyFile( src: string | number, dest: string | number, mode: number, @@ -1490,9 +1520,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function copyFileSync(src: string | number, dest: string | number, mode?: number): void; + export function copyFileSync(src: string | number, dest: string | number, mode?: number): void; /** * Create class Stream. @@ -1563,9 +1594,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createStream(path: string, mode: string): Promise; + export function createStream(path: string, mode: string): Promise; /** * Create class Stream. @@ -1600,9 +1632,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createStream(path: string, mode: string, callback: AsyncCallback): void; + export function createStream(path: string, mode: string, callback: AsyncCallback): void; /** * Create class Stream with sync interface. @@ -1673,9 +1706,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createStreamSync(path: string, mode: string): Stream; + export function createStreamSync(path: string, mode: string): Stream; /** @@ -1748,9 +1782,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createRandomAccessFile(file: string | File, mode?: number, + export function createRandomAccessFile(file: string | File, mode?: number, options?: RandomAccessFileOptions): Promise; /** @@ -1785,9 +1820,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createRandomAccessFile(file: string | File, callback: AsyncCallback): void; + export function createRandomAccessFile(file: string | File, callback: AsyncCallback): void; /** * Create class RandomAccessFile. @@ -1822,9 +1858,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback): void; + export function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback): void; /** * Create class RandomAccessFile with sync interface. @@ -1896,9 +1933,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createRandomAccessFileSync(file: string | File, mode?: number, + export function createRandomAccessFileSync(file: string | File, mode?: number, options?: RandomAccessFileOptions): RandomAccessFile; /** @@ -1924,9 +1962,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; + export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; /** * Create file write stream. @@ -1953,9 +1992,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; + export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; /** * Create watcher to listen for file changes. @@ -1978,9 +2018,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900030 - File name too long * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; + export function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; /** * Duplicate fd to File Object. @@ -1995,9 +2036,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900022 - Too many open files * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function dup(fd: number): File; + export function dup(fd: number): File; /** * Synchronize file metadata. @@ -2028,9 +2070,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fdatasync(fd: number): Promise; + export function fdatasync(fd: number): Promise; /** * Synchronize file metadata. @@ -2061,9 +2104,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fdatasync(fd: number, callback: AsyncCallback): void; + export function fdatasync(fd: number, callback: AsyncCallback): void; /** * Synchronize file metadata with sync interface. @@ -2092,9 +2136,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fdatasyncSync(fd: number): void; + export function fdatasyncSync(fd: number): void; /** * Create class Stream by using fd. @@ -2130,9 +2175,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fdopenStream(fd: number, mode: string): Promise; + export function fdopenStream(fd: number, mode: string): Promise; /** * Create class Stream by using fd. @@ -2168,9 +2214,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; + export function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; /** * Create class Stream by using fd with sync interface. @@ -2206,9 +2253,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fdopenStreamSync(fd: number, mode: string): Stream; + export function fdopenStreamSync(fd: number, mode: string): Stream; /** * Synchronize file. @@ -2239,9 +2287,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fsync(fd: number): Promise; + export function fsync(fd: number): Promise; /** * Synchronize file. @@ -2272,9 +2321,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fsync(fd: number, callback: AsyncCallback): void; + export function fsync(fd: number, callback: AsyncCallback): void; /** * Synchronize file with sync interface. @@ -2303,9 +2353,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function fsyncSync(fd: number): void; + export function fsyncSync(fd: number): void; /** * List file. @@ -2353,9 +2404,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function listFile( + export function listFile( path: string, options?: ListFileOptions ): Promise; @@ -2403,9 +2455,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function listFile(path: string, callback: AsyncCallback): void; + export function listFile(path: string, callback: AsyncCallback): void; /** * List file. @@ -2453,9 +2506,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function listFile( + export function listFile( path: string, options: ListFileOptions, callback: AsyncCallback @@ -2504,9 +2558,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function listFileSync( + export function listFileSync( path: string, options?: ListFileOptions ): string[]; @@ -2540,9 +2595,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function lseek(fd: number, offset: number, whence?: WhenceType): number; + export function lseek(fd: number, offset: number, whence?: WhenceType): number; /** * Stat link file. @@ -2560,9 +2616,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900038 - Value too large for defined data type * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function lstat(path: string): Promise; + export function lstat(path: string): Promise; /** * Stat link file. @@ -2580,9 +2637,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900038 - Value too large for defined data type * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function lstat(path: string, callback: AsyncCallback): void; + export function lstat(path: string, callback: AsyncCallback): void; /** * Stat link file with sync interface. @@ -2600,9 +2658,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900038 - Value too large for defined data type * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function lstatSync(path: string): Stat; + export function lstatSync(path: string): Stat; /** * Make dir. @@ -2674,9 +2733,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdir(path: string): Promise; + export function mkdir(path: string): Promise; /** * Make dir. @@ -2701,9 +2761,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdir(path: string, recursion: boolean): Promise; + export function mkdir(path: string, recursion: boolean): Promise; /** * Make dir. @@ -2775,9 +2836,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdir(path: string, callback: AsyncCallback): void; + export function mkdir(path: string, callback: AsyncCallback): void; /** * Make dir. @@ -2802,9 +2864,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdir(path: string, recursion: boolean, callback: AsyncCallback): void; + export function mkdir(path: string, recursion: boolean, callback: AsyncCallback): void; /** * Make dir with sync interface. @@ -2873,9 +2936,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdirSync(path: string): void; + export function mkdirSync(path: string): void; /** * Make dir with sync interface. @@ -2899,9 +2963,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdirSync(path: string, recursion: boolean): void; + export function mkdirSync(path: string, recursion: boolean): void; /** * Make temp dir. @@ -2948,9 +3013,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdtemp(prefix: string): Promise; + export function mkdtemp(prefix: string): Promise; /** * Make temp dir. @@ -2997,9 +3063,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdtemp(prefix: string, callback: AsyncCallback): void; + export function mkdtemp(prefix: string, callback: AsyncCallback): void; /** * Make temp dir with sync interface. @@ -3046,9 +3113,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function mkdtempSync(prefix: string): string; + export function mkdtempSync(prefix: string): string; /** * Move directory. @@ -3077,9 +3145,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveDir(src: string, dest: string, mode?: number): Promise; + export function moveDir(src: string, dest: string, mode?: number): Promise; /** * Move directory. @@ -3106,9 +3175,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveDir(src: string, dest: string, callback: AsyncCallback): void; + export function moveDir(src: string, dest: string, callback: AsyncCallback): void; /** * Move directory. @@ -3118,9 +3188,10 @@ declare namespace fileIo { * @param { AsyncCallback> } callback - Return the callback function. * @throws { BusinessError } 13900015 - File exists * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveDir(src: string, dest: string, callback: AsyncCallback>): void; + export function moveDir(src: string, dest: string, callback: AsyncCallback>): void; /** * Move directory. @@ -3148,9 +3219,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; + export function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; /** * Move directory. @@ -3161,9 +3233,10 @@ declare namespace fileIo { * @param { AsyncCallback> } callback - Return the callback function. * @throws { BusinessError } 13900015 - File exists * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; + export function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; /** * Move directory with sync interface. @@ -3191,9 +3264,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveDirSync(src: string, dest: string, mode?: number): void; + export function moveDirSync(src: string, dest: string, mode?: number): void; /** * Move file. @@ -3252,9 +3326,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveFile(src: string, dest: string, mode?: number): Promise; + export function moveFile(src: string, dest: string, mode?: number): Promise; /** * Move file. @@ -3311,9 +3386,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveFile(src: string, dest: string, callback: AsyncCallback): void; + export function moveFile(src: string, dest: string, callback: AsyncCallback): void; /** * Move file. @@ -3372,9 +3448,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; + export function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; /** * Move file with sync interface. @@ -3431,9 +3508,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function moveFileSync(src: string, dest: string, mode?: number): void; + export function moveFileSync(src: string, dest: string, mode?: number): void; /** * Open file. @@ -3579,9 +3657,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function open(path: string, mode?: number): Promise; + export function open(path: string, mode?: number): Promise; /** * Open file. @@ -3686,9 +3765,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function open(path: string, callback: AsyncCallback): void; + export function open(path: string, callback: AsyncCallback): void; /** * Open file. @@ -3796,9 +3876,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function open(path: string, mode: number, callback: AsyncCallback): void; + export function open(path: string, mode: number, callback: AsyncCallback): void; /** * Open file with sync interface. @@ -3944,9 +4025,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function openSync(path: string, mode?: number): File; + export function openSync(path: string, mode?: number): File; /** * Read file. @@ -4028,9 +4110,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function read( + export function read( fd: number, buffer: ArrayBuffer, options?: ReadOptions @@ -4091,9 +4174,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; + export function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; /** * Read file. @@ -4153,9 +4237,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function read( + export function read( fd: number, buffer: ArrayBuffer, options: ReadOptions, @@ -4242,9 +4327,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readSync( + export function readSync( fd: number, buffer: ArrayBuffer, options?: ReadOptions @@ -4291,9 +4377,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readLines(filePath: string, options?: Options): Promise; + export function readLines(filePath: string, options?: Options): Promise; /** * Read content line by line. @@ -4313,9 +4400,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readLines(filePath: string, callback: AsyncCallback): void; + export function readLines(filePath: string, callback: AsyncCallback): void; /** * Read content line by line. @@ -4336,9 +4424,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readLines(filePath: string, options: Options, callback: AsyncCallback): void; + export function readLines(filePath: string, options: Options, callback: AsyncCallback): void; /** * Read content line by line with sync interface. @@ -4381,9 +4470,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readLinesSync(filePath: string, options?: Options): ReaderIterator; + export function readLinesSync(filePath: string, options?: Options): ReaderIterator; /** * Read text. @@ -4477,9 +4567,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readText( + export function readText( filePath: string, options?: ReadTextOptions ): Promise; @@ -4548,9 +4639,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readText(filePath: string, callback: AsyncCallback): void; + export function readText(filePath: string, callback: AsyncCallback): void; /** * Read text. @@ -4619,9 +4711,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readText( + export function readText( filePath: string, options: ReadTextOptions, callback: AsyncCallback @@ -4719,9 +4812,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function readTextSync( + export function readTextSync( filePath: string, options?: ReadTextOptions ): string; @@ -4811,9 +4905,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function rename(oldPath: string, newPath: string): Promise; + export function rename(oldPath: string, newPath: string): Promise; /** * Rename file. @@ -4900,9 +4995,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; + export function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; /** * Rename file with sync interface. @@ -4986,9 +5082,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function renameSync(oldPath: string, newPath: string): void; + export function renameSync(oldPath: string, newPath: string): void; /** * Delete dir. @@ -5051,9 +5148,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function rmdir(path: string): Promise; + export function rmdir(path: string): Promise; /** * Delete dir. @@ -5116,9 +5214,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function rmdir(path: string, callback: AsyncCallback): void; + export function rmdir(path: string, callback: AsyncCallback): void; /** * Delete dir with sync interface. @@ -5178,9 +5277,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function rmdirSync(path: string): void; + export function rmdirSync(path: string): void; /** * Get file information. @@ -5246,9 +5346,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function stat(file: string | number): Promise; + export function stat(file: string | number): Promise; /** * Get file information. @@ -5314,9 +5415,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function stat(file: string | number, callback: AsyncCallback): void; + export function stat(file: string | number, callback: AsyncCallback): void; /** * Get file information with sync interface. @@ -5382,9 +5484,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function statSync(file: string | number): Stat; + export function statSync(file: string | number): Stat; /** * Link file. @@ -5407,9 +5510,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function symlink(target: string, srcPath: string): Promise; + export function symlink(target: string, srcPath: string): Promise; /** * Link file. @@ -5432,9 +5536,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function symlink(target: string, srcPath: string, callback: AsyncCallback): void; + export function symlink(target: string, srcPath: string, callback: AsyncCallback): void; /** * Link file with sync interface. @@ -5456,9 +5561,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function symlinkSync(target: string, srcPath: string): void; + export function symlinkSync(target: string, srcPath: string): void; /** * Truncate file. @@ -5536,9 +5642,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function truncate(file: string | number, len?: number): Promise; + export function truncate(file: string | number, len?: number): Promise; /** * Truncate file. @@ -5613,9 +5720,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function truncate(file: string | number, callback: AsyncCallback): void; + export function truncate(file: string | number, callback: AsyncCallback): void; /** * Truncate file. @@ -5693,9 +5801,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function truncate(file: string | number, len: number, callback: AsyncCallback): void; + export function truncate(file: string | number, len: number, callback: AsyncCallback): void; /** * Truncate file with sync interface. @@ -5770,9 +5879,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function truncateSync(file: string | number, len?: number): void; + export function truncateSync(file: string | number, len?: number): void; /** * Delete file. @@ -5844,9 +5954,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function unlink(path: string): Promise; + export function unlink(path: string): Promise; /** * Delete file. @@ -5918,9 +6029,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function unlink(path: string, callback: AsyncCallback): void; + export function unlink(path: string, callback: AsyncCallback): void; /** * Delete file with sync interface. @@ -5989,9 +6101,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function unlinkSync(path: string): void; + export function unlinkSync(path: string): void; /** * Change file mtime. @@ -6020,9 +6133,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function utimes(path: string, mtime: number): void; + export function utimes(path: string, mtime: number): void; /** * Write file. @@ -6091,9 +6205,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function write( + export function write( fd: number, buffer: ArrayBuffer | string, options?: WriteOptions @@ -6163,9 +6278,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; + export function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; /** * Write file. @@ -6234,9 +6350,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function write( + export function write( fd: number, buffer: ArrayBuffer | string, options: WriteOptions, @@ -6310,9 +6427,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function writeSync( + export function writeSync( fd: number, buffer: ArrayBuffer | string, options?: WriteOptions @@ -6331,9 +6449,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900045 - Connection failed. * @throws { BusinessError } 13900046 - Software caused connection abort. * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function connectDfs(networkId: string, listeners: DfsListeners): Promise; + export function connectDfs(networkId: string, listeners: DfsListeners): Promise; /** * Disconnect Distributed File System. @@ -6346,9 +6465,10 @@ declare namespace fileIo { *
2.Incorrect parameter types. * @throws { BusinessError } 13600004 - Unmount failed. * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function disconnectDfs(networkId: string): Promise; + export function disconnectDfs(networkId: string): Promise; /** * Set extended attributes information of the file. @@ -6369,9 +6489,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function setxattr(path: string, key: string, value: string): Promise; + export function setxattr(path: string, key: string, value: string): Promise; /** * Set extended attributes information of the file. @@ -6391,10 +6512,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - - declare function setxattrSync(path: string, key: string, value: string): void; + export function setxattrSync(path: string, key: string, value: string): void; /** * Get extended attributes information of the file. @@ -6412,9 +6533,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900038 - Value too large for defined data type * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function getxattr(path: string, key: string): Promise; + export function getxattr(path: string, key: string): Promise; /** * Get extended attributes information of the file with sync interface. @@ -6432,9 +6554,10 @@ declare namespace fileIo { * @throws { BusinessError } 13900038 - Value too large for defined data type * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare function getxattrSync(path: string, key: string): string; + export function getxattrSync(path: string, key: string): string; } -- Gitee From 418cddaad452b4ceb38576e4557f1365e301cdb7 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Thu, 17 Apr 2025 15:39:34 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: I32223051a22299aec8efca835e90f31f4921ff6b --- api/@ohos.file.fs.d.ts | 479 ++++++++++++++++++++++++++++------------- 1 file changed, 335 insertions(+), 144 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index 922591d0f4..5957a99775 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -6558,8 +6558,6 @@ declare namespace fileIo { * @arkts 1.1&1.2 */ export function getxattrSync(path: string, key: string): string; -} - /** * Progress data of copyFile @@ -8353,6 +8351,341 @@ declare interface Stream { ): number; } +/** + * Watcher object + * + * @interface Watcher + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ +export interface Watcher { + /** + * Start watcher. + * + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + start(): void; + + /** + * Stop watcher. + * + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + stop(): void; +} + +/** + * ReaderIterator object + * + * @interface ReaderIterator + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ +declare interface ReaderIterator { + /** + * Get next result from the iterator. + * + * @returns { ReaderIteratorResult } Returns the result of reader iterator. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + next(): ReaderIteratorResult; +} + +/** + * The listeners of Distributed File System. + * + * @typedef DfsListeners + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ +export interface DfsListeners { + /** + * The Listener of Distributed File System status + * + * @param { string } networkId - The networkId of device. + * @param { number } status - The status code of Distributed File System. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + onStatus(networkId: string, status: number): void; +} + +/** + * Enumeration of different types of whence. + * + * @enum { number } whence type + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ +declare enum WhenceType { + /** + * Starting position of the file offset. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + SEEK_SET = 0, + + /** + * Current position of the file offset. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + SEEK_CUR = 1, + + /** + * Ending position of the file offset. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + SEEK_END = 2, +} + +/** + * Enumeration of different types of file location. + * + * @enum { number } location type + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ +declare enum LocationType { + /** + * Local file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + LOCAL = 1 << 0, + + /** + * Cloud file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + CLOUD = 1 << 1, +} + +/** + * Enumeration of different types of access mode. + * + * @enum { number } access mode type + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ +declare enum AccessModeType { + /** + * Check if the file exists. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + EXIST = 0, + + /** + * Check if the file has write permission. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + WRITE = 2, + + /** + * Check if the file has read permission. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + READ = 4, + + /** + * Check if the file has read and write permission. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + READ_WRITE = 6, +} + +/** + * Enumeration of different types of access flag. + * + * @enum { number } access flag type + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ +declare enum AccessFlagType { + /** + * Check if the file is on the local. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + LOCAL = 0, +} +} + +/** + * Task signal. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ +export class TaskSignal { + /** + * Cancel the copy task in progress. + * + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900012 - Permission denied by the file system + * @throws { BusinessError } 13900043 - No task can be canceled. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + cancel(): void; + + /** + * Subscribe the cancel event of current task. + * + * @returns { Promise } Return the result of the cancel event. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + onCancel(): Promise; +} + +/** + * The AtomicFile class provides methods for performing atomic operations on files. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ +export class AtomicFile { + /** + * The AtomicFile constructor. + * @param { string } path file path. + * @throws { BusinessError } 401 Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + constructor(path: string); + + /** + * Get the File object from AtomicFile object. + * @returns { File } Returns the file object. + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900005 IO error + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + getBaseFile(): File; + + /** + * Create the file read stream. + * @returns { ReadStream } Returns the file read stream. + * @throws { BusinessError } 13900001 Operation not permitted + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + openRead(): ReadStream; + + /** + * Read the entire contents of the file. + * @returns { ArrayBuffer } Returns the ArrayBuffer of the file contents. + * @throws { BusinessError } 13900005 I/O error + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + readFully(): ArrayBuffer; + + /** + * Create the file write stream. + * @returns { WriteStream } Returns the file write stream. + * @throws { BusinessError } 13900001 Operation not permitted + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900027 Read-only file system + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + startWrite(): WriteStream; + + /** + * If the file is written successfully, the file is closed. + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + finishWrite(): void; + + /** + * If writing to the file fails, the file is rolled back. + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + failWrite(): void; + + /** + * Delete all file. + * @throws { BusinessError } 13900001 Operation not permitted + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900027 Read-only file system + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + delete(): void; +} + /** * Implements watcher event listening. * @@ -8488,27 +8821,6 @@ export interface ReaderIteratorResult { value: string; } -/** - * ReaderIterator object - * - * @interface ReaderIterator - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare interface ReaderIterator { - /** - * Get next result from the iterator. - * - * @returns { ReaderIteratorResult } Returns the result of reader iterator. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - next(): ReaderIteratorResult; -} - /** * File filter type * @@ -8913,124 +9225,3 @@ export interface DfsListeners { */ onStatus(networkId: string, status: number): void; } - -/** - * Enumeration of different types of whence. - * - * @enum { number } whence type - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare enum WhenceType { - /** - * Starting position of the file offset. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - SEEK_SET = 0, - - /** - * Current position of the file offset. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - SEEK_CUR = 1, - - /** - * Ending position of the file offset. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - SEEK_END = 2, -} - -/** - * Enumeration of different types of file location. - * - * @enum { number } location type - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare enum LocationType { - /** - * Local file. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - LOCAL = 1 << 0, - - /** - * Cloud file. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - CLOUD = 1 << 1, -} - -/** - * Enumeration of different types of access mode. - * - * @enum { number } access mode type - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ -declare enum AccessModeType { - /** - * Check if the file exists. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - EXIST = 0, - - /** - * Check if the file has write permission. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - WRITE = 2, - - /** - * Check if the file has read permission. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - READ = 4, - - /** - * Check if the file has read and write permission. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - READ_WRITE = 6, -} - -/** - * Enumeration of different types of access flag. - * - * @enum { number } access flag type - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare enum AccessFlagType { - /** - * Check if the file is on the local. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - LOCAL = 0, -} -- Gitee From cf51cacfab0ba5b028f3903d89e5ad9e1d3260c8 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Thu, 17 Apr 2025 17:12:48 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E7=9A=84=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: Ia2994f59a7762863962d747fd6c04c85467cd0f2 --- api/@ohos.file.fs.d.ts | 3783 ++++++++++++++++++++-------------------- 1 file changed, 1892 insertions(+), 1891 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index 5957a99775..92fb845919 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -6558,2012 +6558,2013 @@ declare namespace fileIo { * @arkts 1.1&1.2 */ export function getxattrSync(path: string, key: string): string; - -/** - * Progress data of copyFile - * - * @typedef Progress - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -interface Progress { - /** - * @type { number } - * @readonly - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - readonly processedSize: number; + // function end /** - * @type { number } - * @readonly + * Progress data of copyFile + * + * @typedef Progress * @syscap SystemCapability.FileManagement.File.FileIO * @since 11 */ - readonly totalSize: number; -} + interface Progress { + /** + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + readonly processedSize: number; + + /** + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + readonly totalSize: number; + } -/** - * Task signal. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -export class TaskSignal { /** - * Cancel the copy task in progress. + * Task signal. * - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900012 - Permission denied by the file system - * @throws { BusinessError } 13900043 - No task can be canceled. * @syscap SystemCapability.FileManagement.File.FileIO * @since 12 */ - cancel(): void; + export class TaskSignal { + /** + * Cancel the copy task in progress. + * + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900012 - Permission denied by the file system + * @throws { BusinessError } 13900043 - No task can be canceled. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + cancel(): void; + + /** + * Subscribe the cancel event of current task. + * + * @returns { Promise } Return the result of the cancel event. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + onCancel(): Promise; + } /** - * Subscribe the cancel event of current task. + * Get options of copy * - * @returns { Promise } Return the result of the cancel event. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900042 - Unknown error + * @typedef CopyOptions * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since 11 */ - onCancel(): Promise; -} + interface CopyOptions { + /** + * Listener of copy progress + * + * @type { ?ProgressListener } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + progressListener?: ProgressListener; + /** + * Cancel signal of copy. + * + * @type { ?TaskSignal } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + copySignal?: TaskSignal; + } -/** - * Get options of copy - * - * @typedef CopyOptions - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -interface CopyOptions { /** - * Listener of copy progress + * Listener of copy progress. * - * @type { ?ProgressListener } + * @typedef { function } ProgressListener + * @param { Progress } progress - indicates the progress data of copyFile * @syscap SystemCapability.FileManagement.File.FileIO * @since 11 */ - progressListener?: ProgressListener; - /** - * Cancel signal of copy. - * - * @type { ?TaskSignal } - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - copySignal?: TaskSignal; -} - -/** - * Listener of copy progress. - * - * @typedef { function } ProgressListener - * @param { Progress } progress - indicates the progress data of copyFile - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -type ProgressListener = (progress: Progress) => void; + type ProgressListener = (progress: Progress) => void; -/** - * File object. - * - * @interface File - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * File object. - * - * @interface File - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * File object. - * - * @interface File - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare interface File { /** - * @type { number } - * @readonly + * File object. + * + * @interface File * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ /** - * @type { number } - * @readonly + * File object. + * + * @interface File * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @since 10 */ /** - * @type { number } - * @readonly + * File object. + * + * @interface File * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 11 */ - readonly fd: number; + declare interface File { + /** + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + readonly fd: number; + + /** + * File path + * + * @type { string } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 14300002 - Invalid URI + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + readonly path: string; + + /** + * File name + * + * @type { string } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + readonly name: string; + + /** + * Get parent path of file. + * + * @returns { string } Return the parent path of file. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 14300002 - Invalid URI + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + getParent(): string; + + /** + * Lock file with blocking method. + * + * @param { boolean } exclusive - whether lock is exclusive. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + lock(exclusive?: boolean): Promise; + + /** + * Lock file with blocking method. + * + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + lock(callback: AsyncCallback): void; + + /** + * Lock file with blocking method. + * + * @param { boolean } exclusive - whether lock is exclusive. + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + lock(exclusive: boolean, callback: AsyncCallback): void; + + /** + * Try to lock file with returning results immediately. + * + * @param { boolean } exclusive - whether lock is exclusive. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + tryLock(exclusive?: boolean): void; + + /** + * Unlock file. + * + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + unlock(): void; + } /** - * File path - * - * @type { string } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 14300002 - Invalid URI + * RandomAccessFile object. + * + * @interface RandomAccessFile * @syscap SystemCapability.FileManagement.File.FileIO * @since 10 */ - readonly path: string; + declare interface RandomAccessFile { + + /** + * File descriptor + * + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + readonly fd: number; + + /** + * File pointer + * + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + readonly filePointer: number; + + /** + * Set file pointer. + * + * @param { number } filePointer - filePointer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + setFilePointer(filePointer: number): void; + + /** + * Close randomAccessFile with sync interface. + * + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + close(): void; + + /** + * Write randomAccessFile. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of bytes written to the file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Write randomAccessFile. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @returns { Promise } Returns the number of bytes written to the file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + write( + buffer: ArrayBuffer | string, + options?: WriteOptions + ): Promise; + + /** + * Write randomAccessFile. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; + + /** + * Write randomAccessFile. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Write randomAccessFile. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + write( + buffer: ArrayBuffer | string, + options: WriteOptions, + callback: AsyncCallback + ): void; + + /** + * Write randomAccessFile with sync interface. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Write randomAccessFile with sync interface. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @returns { number } Returns the number of bytes written to the file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + writeSync( + buffer: ArrayBuffer | string, + options?: WriteOptions + ): number; + + /** + * Read randomAccessFile. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Read randomAccessFile. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Read randomAccessFile. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + read( + buffer: ArrayBuffer, + options?: ReadOptions + ): Promise; + + /** + * Read randomAccessFile. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + read(buffer: ArrayBuffer, callback: AsyncCallback): void; + + /** + * Read randomAccessFile. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Read randomAccessFile. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + read( + buffer: ArrayBuffer, + options: ReadOptions, + callback: AsyncCallback + ): void; + + /** + * Read randomAccessFile with sync interface. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + /** + * Read randomAccessFile with sync interface. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { number } Returns the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Read randomAccessFile with sync interface. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { number } Returns the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + readSync( + buffer: ArrayBuffer, + options?: ReadOptions + ): number; + + /** + * Generate read stream from RandomAccessFile object. + * + * @returns { ReadStream } Return ReadStream object. + * @throws { BusinessError } 401 - Parameter error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + getReadStream(): ReadStream; + + /** + * Generate write stream from RandomAccessFile object. + * + * @returns { WriteStream } Return WriteStream object. + * @throws { BusinessError } 401 - Parameter error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + getWriteStream(): WriteStream; + } /** - * File name + * File Read Stream. * - * @type { string } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error + * @extends stream.Readable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since 12 */ - readonly name: string; + declare class ReadStream extends stream.Readable { + /** + * The ReadStream constructor. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + constructor(); + + /** + * The Number of bytes read in the stream. + * + * @type { number } + * @readonly + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + readonly bytesRead: number; + + /** + * The path of the file being read. + * + * @type { string } + * @readonly + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + readonly path: string; + + /** + * Set the file position indicator for the read stream. + * + * @param { number } offset - file offset. + * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. + * @returns { number } Returns the offset relative to starting position of stream. + * @throws { BusinessError } 401 - Parameter error + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900026 - Illegal seek + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + seek(offset: number, whence?: WhenceType): number; + + /** + * Close ReadStream with sync interface. + * + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + close(): void; + } /** - * Get parent path of file. - * - * @returns { string } Return the parent path of file. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 14300002 - Invalid URI + * File Write Stream. + * + * @extends stream.Writable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since 12 */ - getParent(): string; + declare class WriteStream extends stream.Writable { + /** + * The WriteStream constructor. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + constructor(); + + /** + * The Number of bytes written in the stream. + * + * @type { number } + * @readonly + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + readonly bytesWritten: number; + + /** + * The path of the file being written. + * + * @type { string } + * @readonly + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + readonly path: string; + + /** + * Set the file position indicator for the write stream. + * + * @param { number } offset - file offset. + * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. + * @returns { number } Returns the offset relative to starting position of stream. + * @throws { BusinessError } 401 - Parameter error + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900026 - Illegal seek + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + seek(offset: number, whence?: WhenceType): number; + + /** + * Close WriteStream with sync interface. + * + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + close(): void; + } /** - * Lock file with blocking method. - * - * @param { boolean } exclusive - whether lock is exclusive. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available + * The AtomicFile class provides methods for performing atomic operations on files. * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since 15 */ - lock(exclusive?: boolean): Promise; + export class AtomicFile { + /** + * The AtomicFile constructor. + * @param { string } path file path. + * @throws { BusinessError } 401 Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + constructor(path: string); + + /** + * Get the File object from AtomicFile object. + * @returns { File } Returns the file object. + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900005 IO error + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + getBaseFile(): File; + + /** + * Create the file read stream. + * @returns { ReadStream } Returns the file read stream. + * @throws { BusinessError } 13900001 Operation not permitted + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + openRead(): ReadStream; + + /** + * Read the entire contents of the file. + * @returns { ArrayBuffer } Returns the ArrayBuffer of the file contents. + * @throws { BusinessError } 13900005 I/O error + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + readFully(): ArrayBuffer; + + /** + * Create the file write stream. + * @returns { WriteStream } Returns the file write stream. + * @throws { BusinessError } 13900001 Operation not permitted + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900027 Read-only file system + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + startWrite(): WriteStream; + + /** + * If the file is written successfully, the file is closed. + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + finishWrite(): void; + + /** + * If writing to the file fails, the file is rolled back. + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + failWrite(): void; + + /** + * Delete all file. + * @throws { BusinessError } 13900001 Operation not permitted + * @throws { BusinessError } 13900002 No such file or directory + * @throws { BusinessError } 13900012 Permission denied + * @throws { BusinessError } 13900027 Read-only file system + * @throws { BusinessError } 13900042 Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + delete(): void; + } /** - * Lock file with blocking method. + * Stat object. * - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available + * @interface Stat * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ - lock(callback: AsyncCallback): void; - /** - * Lock file with blocking method. + * Stat object. * - * @param { boolean } exclusive - whether lock is exclusive. - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available + * @interface Stat * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @crossplatform + * @since 10 */ - lock(exclusive: boolean, callback: AsyncCallback): void; - /** - * Try to lock file with returning results immediately. + * Stat object. * - * @param { boolean } exclusive - whether lock is exclusive. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available + * @interface Stat * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @crossplatform + * @atomicservice + * @since 11 */ - tryLock(exclusive?: boolean): void; + declare interface Stat { + /** + * @type { bigint } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { bigint } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + readonly ino: bigint; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + readonly mode: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + readonly uid: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + readonly gid: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + readonly size: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + readonly atime: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + readonly mtime: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + readonly ctime: number; + + /** + * Returns nanosecond of the access time. + * @type { bigint } + * @readonly + * @throws { BusinessError } 13900042 - Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + readonly atimeNs?:bigint; + + /** + * Returns nanosecond of the modification time. + * @type { bigint } + * @readonly + * @throws { BusinessError } 13900042 - Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + readonly mtimeNs?:bigint; + + /** + * Returns nanosecond of the change time. + * @type { bigint } + * @readonly + * @throws { BusinessError } 13900042 - Internal error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 15 + */ + readonly ctimeNs?:bigint; + + /** + * + * @type { LocationType } + * @readonly + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + readonly location: LocationType; + + /** + * Whether path/fd is block device. + * + * @returns { boolean } Returns whether the path/fd point to a block device or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Whether path/fd is block device. + * + * @returns { boolean } Returns whether the path/fd point to a block device or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + isBlockDevice(): boolean; + /** + * Whether path/fd is character device. + * + * @returns { boolean } Returns whether the path/fd point to a character device or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Whether path/fd is character device. + * + * @returns { boolean } Returns whether the path/fd point to a character device or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + isCharacterDevice(): boolean; + /** + * Whether path/fd is directory. + * + * @returns { boolean } Returns whether the path/fd point to a directory or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Whether path/fd is directory. + * + * @returns { boolean } Returns whether the path/fd point to a directory or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Whether path/fd is directory. + * + * @returns { boolean } Returns whether the path/fd point to a directory or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + isDirectory(): boolean; + /** + * Whether path/fd is fifo. + * + * @returns { boolean } Returns whether the path/fd point to a fifo file or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Whether path/fd is fifo. + * + * @returns { boolean } Returns whether the path/fd point to a fifo file or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + isFIFO(): boolean; + /** + * Whether path/fd is file. + * + * @returns { boolean } Returns whether the path/fd point to a normal file or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Whether path/fd is file. + * + * @returns { boolean } Returns whether the path/fd point to a normal file or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + /** + * Whether path/fd is file. + * + * @returns { boolean } Returns whether the path/fd point to a normal file or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @atomicservice + * @since 11 + */ + isFile(): boolean; + /** + * Whether path/fd is socket. + * + * @returns { boolean } Returns whether the path/fd point to a socket file or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Whether path/fd is socket. + * + * @returns { boolean } Returns whether the path/fd point to a socket file or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + isSocket(): boolean; + /** + * Whether path/fd is symbolic link. + * + * @returns { boolean } Returns whether the path/fd point to a symbolic link or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Whether path/fd is symbolic link. + * + * @returns { boolean } Returns whether the path/fd point to a symbolic link or not. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @crossplatform + * @since 10 + */ + isSymbolicLink(): boolean; + } /** - * Unlock file. + * Stream object * - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available + * @interface Stream * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ - unlock(): void; -} - -/** - * RandomAccessFile object. - * - * @interface RandomAccessFile - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -declare interface RandomAccessFile { + declare interface Stream { + /** + * Close stream. + * + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + close(): Promise; + + /** + * Close stream. + * + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + close(callback: AsyncCallback): void; + + /** + * Close stream with sync interface. + * + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + closeSync(): void; + + /** + * Flush stream. + * + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + flush(): Promise; + + /** + * Flush stream. + * + * @param { AsyncCallback } callback - Return the callback function. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + flush(callback: AsyncCallback): void; + + /** + * Flush stream with sync interface. + * + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + flushSync(): void; + + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of file bytes written to file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @returns { Promise } Returns the number of file bytes written to file in promise mode. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + write( + buffer: ArrayBuffer | string, + options?: WriteOptions + ): Promise; + + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes written to file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; + + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes written to file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes written to file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + write( + buffer: ArrayBuffer | string, + options: WriteOptions, + callback: AsyncCallback + ): void; + + /** + * Write stream with sync interface. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of file bytes written to file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Write stream with sync interface. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { WriteOptions } [options] - options. + * @returns { number } Returns the number of file bytes written to file. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + writeSync( + buffer: ArrayBuffer | string, + options?: WriteOptions + ): number; + + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + read( + buffer: ArrayBuffer, + options?: ReadOptions + ): Promise; + + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + read(buffer: ArrayBuffer, callback: AsyncCallback): void; + + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + read( + buffer: ArrayBuffer, + options: ReadOptions, + callback: AsyncCallback + ): void; + + /** + * Read stream with sync interface. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { object } [options] - options. + * @returns { number } Returns the number of file bytes read to file. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + /** + * Read stream with sync interface. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { number } Returns the number of file bytes read to file. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + /** + * Read stream with sync interface. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { ReadOptions } [options] - options. + * @returns { number } Returns the number of file bytes read to file. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900044 - Network is unreachable + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + readSync( + buffer: ArrayBuffer, + options?: ReadOptions + ): number; + } /** - * File descriptor + * Watcher object * - * @type { number } - * @readonly + * @interface Watcher * @syscap SystemCapability.FileManagement.File.FileIO * @since 10 */ - readonly fd: number; + export interface Watcher { + /** + * Start watcher. + * + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + start(): void; + + /** + * Stop watcher. + * + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ + stop(): void; + } /** - * File pointer + * ReaderIterator object * - * @type { number } - * @readonly + * @interface ReaderIterator * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since 11 */ - readonly filePointer: number; + declare interface ReaderIterator { + /** + * Get next result from the iterator. + * + * @returns { ReaderIteratorResult } Returns the result of reader iterator. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + next(): ReaderIteratorResult; + } /** - * Set file pointer. + * The listeners of Distributed File System. * - * @param { number } filePointer - filePointer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900042 - Unknown error + * @typedef DfsListeners * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since 12 */ - setFilePointer(filePointer: number): void; + export interface DfsListeners { + /** + * The Listener of Distributed File System status + * + * @param { string } networkId - The networkId of device. + * @param { number } status - The status code of Distributed File System. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + onStatus(networkId: string, status: number): void; + } /** - * Close randomAccessFile with sync interface. + * Enumeration of different types of whence. * - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error + * @enum { number } whence type * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since 11 */ - close(): void; + declare enum WhenceType { + /** + * Starting position of the file offset. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + SEEK_SET = 0, + + /** + * Current position of the file offset. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + SEEK_CUR = 1, + + /** + * Ending position of the file offset. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + SEEK_END = 2, + } /** - * Write randomAccessFile. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of bytes written to the file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - /** - * Write randomAccessFile. + * Enumeration of different types of file location. * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @returns { Promise } Returns the number of bytes written to the file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error + * @enum { number } location type * @syscap SystemCapability.FileManagement.File.FileIO * @since 11 */ - write( - buffer: ArrayBuffer | string, - options?: WriteOptions - ): Promise; + declare enum LocationType { + /** + * Local file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + LOCAL = 1 << 0, + + /** + * Cloud file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + CLOUD = 1 << 1, + } /** - * Write randomAccessFile. + * Enumeration of different types of access mode. * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error + * @enum { number } access mode type * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @atomicservice + * @since 12 */ - write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; + declare enum AccessModeType { + /** + * Check if the file exists. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + EXIST = 0, + + /** + * Check if the file has write permission. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + WRITE = 2, + + /** + * Check if the file has read permission. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + READ = 4, + + /** + * Check if the file has read and write permission. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @atomicservice + * @since 12 + */ + READ_WRITE = 6, + } /** - * Write randomAccessFile. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - /** - * Write randomAccessFile. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - write( - buffer: ArrayBuffer | string, - options: WriteOptions, - callback: AsyncCallback - ): void; - - /** - * Write randomAccessFile with sync interface. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - /** - * Write randomAccessFile with sync interface. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @returns { number } Returns the number of bytes written to the file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - writeSync( - buffer: ArrayBuffer | string, - options?: WriteOptions - ): number; - - /** - * Read randomAccessFile. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - /** - * Read randomAccessFile. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - /** - * Read randomAccessFile. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - read( - buffer: ArrayBuffer, - options?: ReadOptions - ): Promise; - - /** - * Read randomAccessFile. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - read(buffer: ArrayBuffer, callback: AsyncCallback): void; - - /** - * Read randomAccessFile. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - /** - * Read randomAccessFile. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - read( - buffer: ArrayBuffer, - options: ReadOptions, - callback: AsyncCallback - ): void; - - /** - * Read randomAccessFile with sync interface. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - /** - * Read randomAccessFile with sync interface. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - /** - * Read randomAccessFile with sync interface. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - readSync( - buffer: ArrayBuffer, - options?: ReadOptions - ): number; - - /** - * Generate read stream from RandomAccessFile object. - * - * @returns { ReadStream } Return ReadStream object. - * @throws { BusinessError } 401 - Parameter error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - getReadStream(): ReadStream; - - /** - * Generate write stream from RandomAccessFile object. - * - * @returns { WriteStream } Return WriteStream object. - * @throws { BusinessError } 401 - Parameter error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - getWriteStream(): WriteStream; -} - -/** - * File Read Stream. - * - * @extends stream.Readable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare class ReadStream extends stream.Readable { - /** - * The ReadStream constructor. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - constructor(); - - /** - * The Number of bytes read in the stream. - * - * @type { number } - * @readonly - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - readonly bytesRead: number; - - /** - * The path of the file being read. - * - * @type { string } - * @readonly - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - readonly path: string; - - /** - * Set the file position indicator for the read stream. - * - * @param { number } offset - file offset. - * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. - * @returns { number } Returns the offset relative to starting position of stream. - * @throws { BusinessError } 401 - Parameter error - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900026 - Illegal seek - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - seek(offset: number, whence?: WhenceType): number; - - /** - * Close ReadStream with sync interface. - * - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - close(): void; -} - -/** - * File Write Stream. - * - * @extends stream.Writable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare class WriteStream extends stream.Writable { - /** - * The WriteStream constructor. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - constructor(); - - /** - * The Number of bytes written in the stream. - * - * @type { number } - * @readonly - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - readonly bytesWritten: number; - - /** - * The path of the file being written. - * - * @type { string } - * @readonly - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - readonly path: string; - - /** - * Set the file position indicator for the write stream. - * - * @param { number } offset - file offset. - * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. - * @returns { number } Returns the offset relative to starting position of stream. - * @throws { BusinessError } 401 - Parameter error - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900026 - Illegal seek - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - seek(offset: number, whence?: WhenceType): number; - - /** - * Close WriteStream with sync interface. - * - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - close(): void; -} - -/** - * The AtomicFile class provides methods for performing atomic operations on files. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ -export class AtomicFile { - /** - * The AtomicFile constructor. - * @param { string } path file path. - * @throws { BusinessError } 401 Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - constructor(path: string); - - /** - * Get the File object from AtomicFile object. - * @returns { File } Returns the file object. - * @throws { BusinessError } 13900002 No such file or directory - * @throws { BusinessError } 13900005 IO error - * @throws { BusinessError } 13900012 Permission denied - * @throws { BusinessError } 13900042 Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - getBaseFile(): File; - - /** - * Create the file read stream. - * @returns { ReadStream } Returns the file read stream. - * @throws { BusinessError } 13900001 Operation not permitted - * @throws { BusinessError } 13900002 No such file or directory - * @throws { BusinessError } 13900012 Permission denied - * @throws { BusinessError } 13900042 Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - openRead(): ReadStream; - - /** - * Read the entire contents of the file. - * @returns { ArrayBuffer } Returns the ArrayBuffer of the file contents. - * @throws { BusinessError } 13900005 I/O error - * @throws { BusinessError } 13900042 Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - readFully(): ArrayBuffer; - - /** - * Create the file write stream. - * @returns { WriteStream } Returns the file write stream. - * @throws { BusinessError } 13900001 Operation not permitted - * @throws { BusinessError } 13900002 No such file or directory - * @throws { BusinessError } 13900012 Permission denied - * @throws { BusinessError } 13900027 Read-only file system - * @throws { BusinessError } 13900042 Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - startWrite(): WriteStream; - - /** - * If the file is written successfully, the file is closed. - * @throws { BusinessError } 13900042 Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - finishWrite(): void; - - /** - * If writing to the file fails, the file is rolled back. - * @throws { BusinessError } 13900042 Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - failWrite(): void; - - /** - * Delete all file. - * @throws { BusinessError } 13900001 Operation not permitted - * @throws { BusinessError } 13900002 No such file or directory - * @throws { BusinessError } 13900012 Permission denied - * @throws { BusinessError } 13900027 Read-only file system - * @throws { BusinessError } 13900042 Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - delete(): void; -} - -/** - * Stat object. - * - * @interface Stat - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -/** - * Stat object. - * - * @interface Stat - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ -/** - * Stat object. - * - * @interface Stat - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ -declare interface Stat { - /** - * @type { bigint } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { bigint } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - readonly ino: bigint; - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ - readonly mode: number; - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - readonly uid: number; - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - readonly gid: number; - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ - readonly size: number; - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ - readonly atime: number; - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ - readonly mtime: number; - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * @type { number } - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - readonly ctime: number; - - /** - * Returns nanosecond of the access time. - * @type { bigint } - * @readonly - * @throws { BusinessError } 13900042 - Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - readonly atimeNs?:bigint; - - /** - * Returns nanosecond of the modification time. - * @type { bigint } - * @readonly - * @throws { BusinessError } 13900042 - Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - readonly mtimeNs?:bigint; - - /** - * Returns nanosecond of the change time. - * @type { bigint } - * @readonly - * @throws { BusinessError } 13900042 - Internal error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 - */ - readonly ctimeNs?:bigint; - - /** - * - * @type { LocationType } - * @readonly - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - readonly location: LocationType; - - /** - * Whether path/fd is block device. - * - * @returns { boolean } Returns whether the path/fd point to a block device or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Whether path/fd is block device. - * - * @returns { boolean } Returns whether the path/fd point to a block device or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - isBlockDevice(): boolean; - /** - * Whether path/fd is character device. - * - * @returns { boolean } Returns whether the path/fd point to a character device or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Whether path/fd is character device. - * - * @returns { boolean } Returns whether the path/fd point to a character device or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - isCharacterDevice(): boolean; - /** - * Whether path/fd is directory. - * - * @returns { boolean } Returns whether the path/fd point to a directory or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Whether path/fd is directory. - * - * @returns { boolean } Returns whether the path/fd point to a directory or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - /** - * Whether path/fd is directory. - * - * @returns { boolean } Returns whether the path/fd point to a directory or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ - isDirectory(): boolean; - /** - * Whether path/fd is fifo. - * - * @returns { boolean } Returns whether the path/fd point to a fifo file or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Whether path/fd is fifo. - * - * @returns { boolean } Returns whether the path/fd point to a fifo file or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - isFIFO(): boolean; - /** - * Whether path/fd is file. - * - * @returns { boolean } Returns whether the path/fd point to a normal file or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Whether path/fd is file. - * - * @returns { boolean } Returns whether the path/fd point to a normal file or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - /** - * Whether path/fd is file. - * - * @returns { boolean } Returns whether the path/fd point to a normal file or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @atomicservice - * @since 11 - */ - isFile(): boolean; - /** - * Whether path/fd is socket. - * - * @returns { boolean } Returns whether the path/fd point to a socket file or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Whether path/fd is socket. - * - * @returns { boolean } Returns whether the path/fd point to a socket file or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - isSocket(): boolean; - /** - * Whether path/fd is symbolic link. - * - * @returns { boolean } Returns whether the path/fd point to a symbolic link or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Whether path/fd is symbolic link. - * - * @returns { boolean } Returns whether the path/fd point to a symbolic link or not. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @crossplatform - * @since 10 - */ - isSymbolicLink(): boolean; -} - -/** - * Stream object - * - * @interface Stream - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ -declare interface Stream { - /** - * Close stream. - * - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - close(): Promise; - - /** - * Close stream. - * - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - close(callback: AsyncCallback): void; - - /** - * Close stream with sync interface. - * - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - closeSync(): void; - - /** - * Flush stream. - * - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - flush(): Promise; - - /** - * Flush stream. - * - * @param { AsyncCallback } callback - Return the callback function. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - flush(callback: AsyncCallback): void; - - /** - * Flush stream with sync interface. - * - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - flushSync(): void; - - /** - * Write stream. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of file bytes written to file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Write stream. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes written to file in promise mode. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - write( - buffer: ArrayBuffer | string, - options?: WriteOptions - ): Promise; - - /** - * Write stream. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes written to file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; - - /** - * Write stream. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes written to file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Write stream. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes written to file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - write( - buffer: ArrayBuffer | string, - options: WriteOptions, - callback: AsyncCallback - ): void; - - /** - * Write stream with sync interface. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of file bytes written to file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Write stream with sync interface. - * - * @param { ArrayBuffer | string } buffer - buffer. - * @param { WriteOptions } [options] - options. - * @returns { number } Returns the number of file bytes written to file. - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - writeSync( - buffer: ArrayBuffer | string, - options?: WriteOptions - ): number; - - /** - * Read stream. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Read stream. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - /** - * Read stream. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - read( - buffer: ArrayBuffer, - options?: ReadOptions - ): Promise; - - /** - * Read stream. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - read(buffer: ArrayBuffer, callback: AsyncCallback): void; - - /** - * Read stream. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Read stream. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to buffer. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - read( - buffer: ArrayBuffer, - options: ReadOptions, - callback: AsyncCallback - ): void; - - /** - * Read stream with sync interface. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { object } [options] - options. - * @returns { number } Returns the number of file bytes read to file. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - */ - /** - * Read stream with sync interface. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to file. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - /** - * Read stream with sync interface. - * - * @param { ArrayBuffer } buffer - buffer. - * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to file. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900044 - Network is unreachable - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - readSync( - buffer: ArrayBuffer, - options?: ReadOptions - ): number; -} - -/** - * Watcher object - * - * @interface Watcher - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ -export interface Watcher { - /** - * Start watcher. - * - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - start(): void; - - /** - * Stop watcher. - * - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - */ - stop(): void; -} - -/** - * ReaderIterator object - * - * @interface ReaderIterator - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare interface ReaderIterator { - /** - * Get next result from the iterator. - * - * @returns { ReaderIteratorResult } Returns the result of reader iterator. - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900042 - Unknown error - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - next(): ReaderIteratorResult; -} - -/** - * The listeners of Distributed File System. - * - * @typedef DfsListeners - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -export interface DfsListeners { - /** - * The Listener of Distributed File System status - * - * @param { string } networkId - The networkId of device. - * @param { number } status - The status code of Distributed File System. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - onStatus(networkId: string, status: number): void; -} - -/** - * Enumeration of different types of whence. - * - * @enum { number } whence type - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare enum WhenceType { - /** - * Starting position of the file offset. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - SEEK_SET = 0, - - /** - * Current position of the file offset. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - SEEK_CUR = 1, - - /** - * Ending position of the file offset. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - SEEK_END = 2, -} - -/** - * Enumeration of different types of file location. - * - * @enum { number } location type - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ -declare enum LocationType { - /** - * Local file. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - LOCAL = 1 << 0, - - /** - * Cloud file. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 - */ - CLOUD = 1 << 1, -} - -/** - * Enumeration of different types of access mode. - * - * @enum { number } access mode type - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ -declare enum AccessModeType { - /** - * Check if the file exists. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - EXIST = 0, - - /** - * Check if the file has write permission. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - WRITE = 2, - - /** - * Check if the file has read permission. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - READ = 4, - - /** - * Check if the file has read and write permission. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @atomicservice - * @since 12 - */ - READ_WRITE = 6, -} - -/** - * Enumeration of different types of access flag. - * - * @enum { number } access flag type - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ -declare enum AccessFlagType { - /** - * Check if the file is on the local. + * Enumeration of different types of access flag. * + * @enum { number } access flag type * @syscap SystemCapability.FileManagement.File.FileIO * @since 12 */ - LOCAL = 0, -} + declare enum AccessFlagType { + /** + * Check if the file is on the local. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + LOCAL = 0, + } } - +// namespace end /** * Task signal. * -- Gitee From d082082efe336cda4b490d8b8690cc04b1017a19 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Fri, 18 Apr 2025 12:31:04 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BD=93=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: If1ff39c9b317b695211dcfed797946dcf62083e0 --- api/@ohos.file.fs.d.ts | 565 ++++++++++++++++++++++++++--------------- 1 file changed, 365 insertions(+), 200 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index 92fb845919..b117058a35 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -57,26 +57,12 @@ export default fileIo; * @since 12 */ declare namespace fileIo { - export { AccessModeType }; - export { AccessFlagType }; - export { File }; - export { OpenMode }; - export { RandomAccessFile }; - export { ReaderIterator }; - export { Stat }; - export { Stream }; - export { ReadStream }; - export { WriteStream }; - export { AtomicFile }; - export { Watcher }; - export { WhenceType }; - export { TaskSignal }; - export { connectDfs }; - export { disconnectDfs }; + /*** if arkts 1.1 */ export type { Progress }; export type { CopyOptions }; export type { ProgressListener }; export type { DfsListeners }; + /*** endif */ /** * Mode Indicates the open flags. @@ -103,7 +89,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - namespace OpenMode { + export namespace OpenMode { /** * Read only Permission. * @@ -6565,14 +6551,16 @@ declare namespace fileIo { * * @typedef Progress * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - interface Progress { + export interface Progress { /** * @type { number } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly processedSize: number; @@ -6580,7 +6568,8 @@ declare namespace fileIo { * @type { number } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly totalSize: number; } @@ -6589,7 +6578,8 @@ declare namespace fileIo { * Task signal. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since 20 + * @arkts 1.2 */ export class TaskSignal { /** @@ -6599,7 +6589,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900012 - Permission denied by the file system * @throws { BusinessError } 13900043 - No task can be canceled. * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since 20 + * @arkts 1.2 */ cancel(): void; @@ -6611,7 +6602,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900008 - Bad file descriptor * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since 20 + * @arkts 1.2 */ onCancel(): Promise; } @@ -6621,15 +6613,17 @@ declare namespace fileIo { * * @typedef CopyOptions * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - interface CopyOptions { + export interface CopyOptions { /** * Listener of copy progress * * @type { ?ProgressListener } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ progressListener?: ProgressListener; /** @@ -6637,7 +6631,8 @@ declare namespace fileIo { * * @type { ?TaskSignal } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ copySignal?: TaskSignal; } @@ -6648,9 +6643,10 @@ declare namespace fileIo { * @typedef { function } ProgressListener * @param { Progress } progress - indicates the progress data of copyFile * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - type ProgressListener = (progress: Progress) => void; + export type ProgressListener = (progress: Progress) => void; /** * File object. @@ -6674,9 +6670,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare interface File { + export interface File { /** * @type { number } * @readonly @@ -6696,7 +6693,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly fd: number; @@ -6709,7 +6707,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 14300002 - Invalid URI * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly path: string; @@ -6721,7 +6720,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly name: string; @@ -6733,7 +6733,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 14300002 - Invalid URI * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getParent(): string; @@ -6749,7 +6750,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900043 - No record locks available * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ lock(exclusive?: boolean): Promise; @@ -6764,7 +6766,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900043 - No record locks available * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ lock(callback: AsyncCallback): void; @@ -6780,7 +6783,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900043 - No record locks available * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ lock(exclusive: boolean, callback: AsyncCallback): void; @@ -6795,7 +6799,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900043 - No record locks available * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ tryLock(exclusive?: boolean): void; @@ -6809,7 +6814,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900043 - No record locks available * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ unlock(): void; } @@ -6819,9 +6825,10 @@ declare namespace fileIo { * * @interface RandomAccessFile * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare interface RandomAccessFile { + export interface RandomAccessFile { /** * File descriptor @@ -6829,7 +6836,8 @@ declare namespace fileIo { * @type { number } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly fd: number; @@ -6839,7 +6847,8 @@ declare namespace fileIo { * @type { number } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly filePointer: number; @@ -6853,7 +6862,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ setFilePointer(filePointer: number): void; @@ -6867,7 +6877,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ close(): void; @@ -6911,7 +6922,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ write( buffer: ArrayBuffer | string, @@ -6936,7 +6948,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; @@ -6980,7 +6993,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ write( buffer: ArrayBuffer | string, @@ -7028,7 +7042,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ writeSync( buffer: ArrayBuffer | string, @@ -7088,7 +7103,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ read( buffer: ArrayBuffer, @@ -7110,7 +7126,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900034 - Operation would block * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ read(buffer: ArrayBuffer, callback: AsyncCallback): void; @@ -7148,7 +7165,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900034 - Operation would block * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ read( buffer: ArrayBuffer, @@ -7209,7 +7227,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ readSync( buffer: ArrayBuffer, @@ -7227,7 +7246,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ getReadStream(): ReadStream; @@ -7242,7 +7262,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ getWriteStream(): WriteStream; } @@ -7252,14 +7273,16 @@ declare namespace fileIo { * * @extends stream.Readable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare class ReadStream extends stream.Readable { + export class ReadStream extends stream.Readable { /** * The ReadStream constructor. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ constructor(); @@ -7270,7 +7293,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly bytesRead: number; @@ -7281,7 +7305,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly path: string; @@ -7296,7 +7321,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900026 - Illegal seek * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ seek(offset: number, whence?: WhenceType): number; @@ -7310,7 +7336,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ close(): void; } @@ -7320,14 +7347,16 @@ declare namespace fileIo { * * @extends stream.Writable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare class WriteStream extends stream.Writable { + export class WriteStream extends stream.Writable { /** * The WriteStream constructor. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ constructor(); @@ -7338,7 +7367,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly bytesWritten: number; @@ -7349,7 +7379,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly path: string; @@ -7364,7 +7395,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900026 - Illegal seek * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ seek(offset: number, whence?: WhenceType): number; @@ -7378,7 +7410,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ close(): void; } @@ -7386,7 +7419,8 @@ declare namespace fileIo { /** * The AtomicFile class provides methods for performing atomic operations on files. * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ export class AtomicFile { /** @@ -7394,7 +7428,8 @@ declare namespace fileIo { * @param { string } path file path. * @throws { BusinessError } 401 Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ constructor(path: string); @@ -7406,7 +7441,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900012 Permission denied * @throws { BusinessError } 13900042 Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ getBaseFile(): File; @@ -7418,7 +7454,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900012 Permission denied * @throws { BusinessError } 13900042 Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ openRead(): ReadStream; @@ -7428,7 +7465,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900005 I/O error * @throws { BusinessError } 13900042 Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ readFully(): ArrayBuffer; @@ -7441,7 +7479,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900027 Read-only file system * @throws { BusinessError } 13900042 Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ startWrite(): WriteStream; @@ -7449,7 +7488,8 @@ declare namespace fileIo { * If the file is written successfully, the file is closed. * @throws { BusinessError } 13900042 Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ finishWrite(): void; @@ -7457,7 +7497,8 @@ declare namespace fileIo { * If writing to the file fails, the file is rolled back. * @throws { BusinessError } 13900042 Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ failWrite(): void; @@ -7469,7 +7510,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900027 Read-only file system * @throws { BusinessError } 13900042 Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since 20 + * @arkts 1.2 */ delete(): void; } @@ -7496,9 +7538,10 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare interface Stat { + export interface Stat { /** * @type { bigint } * @readonly @@ -7514,7 +7557,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly ino: bigint; /** @@ -7542,7 +7586,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly mode: number; /** @@ -7564,7 +7609,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly uid: number; /** @@ -7582,7 +7628,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly gid: number; /** @@ -7610,7 +7657,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly size: number; /** @@ -7638,7 +7686,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly atime: number; /** @@ -7666,7 +7715,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly mtime: number; /** @@ -7684,7 +7734,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly ctime: number; @@ -7694,7 +7745,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly atimeNs?:bigint; @@ -7704,7 +7756,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly mtimeNs?:bigint; @@ -7714,7 +7767,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Internal error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 15 + * @since {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly ctimeNs?:bigint; @@ -7724,7 +7778,8 @@ declare namespace fileIo { * @readonly * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly location: LocationType; @@ -7745,7 +7800,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ isBlockDevice(): boolean; /** @@ -7765,7 +7821,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ isCharacterDevice(): boolean; /** @@ -7796,7 +7853,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ isDirectory(): boolean; /** @@ -7816,7 +7874,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ isFIFO(): boolean; /** @@ -7847,7 +7906,8 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ isFile(): boolean; /** @@ -7867,7 +7927,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ isSocket(): boolean; /** @@ -7887,7 +7948,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ isSymbolicLink(): boolean; } @@ -7897,9 +7959,10 @@ declare namespace fileIo { * * @interface Stream * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare interface Stream { + export interface Stream { /** * Close stream. * @@ -7911,7 +7974,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ close(): Promise; @@ -7926,7 +7990,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ close(callback: AsyncCallback): void; @@ -7940,7 +8005,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ closeSync(): void; @@ -7961,7 +8027,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ flush(): Promise; @@ -7982,7 +8049,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ flush(callback: AsyncCallback): void; @@ -8002,7 +8070,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ flushSync(): void; @@ -8046,7 +8115,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ write( buffer: ArrayBuffer | string, @@ -8071,7 +8141,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; @@ -8115,7 +8186,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ write( buffer: ArrayBuffer | string, @@ -8163,7 +8235,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ writeSync( buffer: ArrayBuffer | string, @@ -8223,7 +8296,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ read( buffer: ArrayBuffer, @@ -8245,7 +8319,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900034 - Operation would block * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ read(buffer: ArrayBuffer, callback: AsyncCallback): void; @@ -8283,7 +8358,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900034 - Operation would block * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ read( buffer: ArrayBuffer, @@ -8344,7 +8420,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900042 - Unknown error * @throws { BusinessError } 13900044 - Network is unreachable * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ readSync( buffer: ArrayBuffer, @@ -8357,7 +8434,8 @@ declare namespace fileIo { * * @interface Watcher * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since 20 + * @arkts 1.2 */ export interface Watcher { /** @@ -8377,7 +8455,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900030 - File name too long * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since 20 + * @arkts 1.2 */ start(): void; @@ -8398,7 +8477,8 @@ declare namespace fileIo { * @throws { BusinessError } 13900030 - File name too long * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since 20 + * @arkts 1.2 */ stop(): void; } @@ -8408,9 +8488,10 @@ declare namespace fileIo { * * @interface ReaderIterator * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare interface ReaderIterator { + export interface ReaderIterator { /** * Get next result from the iterator. * @@ -8419,43 +8500,48 @@ declare namespace fileIo { * @throws { BusinessError } 13900037 - No data available * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ next(): ReaderIteratorResult; } - /** - * The listeners of Distributed File System. - * - * @typedef DfsListeners - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - export interface DfsListeners { - /** - * The Listener of Distributed File System status - * - * @param { string } networkId - The networkId of device. - * @param { number } status - The status code of Distributed File System. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 - */ - onStatus(networkId: string, status: number): void; - } + // /** + // * The listeners of Distributed File System. + // * + // * @typedef DfsListeners + // * @syscap SystemCapability.FileManagement.File.FileIO + // * @since 12 + // * @arkts 1.1&1.2 + // */ + // export interface DfsListeners { + // /** + // * The Listener of Distributed File System status + // * + // * @param { string } networkId - The networkId of device. + // * @param { number } status - The status code of Distributed File System. + // * @syscap SystemCapability.FileManagement.File.FileIO + // * @since 12 + // * @arkts 1.1&1.2 + // */ + // onStatus(networkId: string, status: number): void; + // } /** * Enumeration of different types of whence. * * @enum { number } whence type * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare enum WhenceType { + export enum WhenceType { /** * Starting position of the file offset. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ SEEK_SET = 0, @@ -8463,7 +8549,8 @@ declare namespace fileIo { * Current position of the file offset. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ SEEK_CUR = 1, @@ -8471,7 +8558,8 @@ declare namespace fileIo { * Ending position of the file offset. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ SEEK_END = 2, } @@ -8481,14 +8569,16 @@ declare namespace fileIo { * * @enum { number } location type * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare enum LocationType { + export enum LocationType { /** * Local file. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ LOCAL = 1 << 0, @@ -8496,7 +8586,8 @@ declare namespace fileIo { * Cloud file. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ CLOUD = 1 << 1, } @@ -8507,15 +8598,17 @@ declare namespace fileIo { * @enum { number } access mode type * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare enum AccessModeType { + export enum AccessModeType { /** * Check if the file exists. * * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ EXIST = 0, @@ -8524,7 +8617,8 @@ declare namespace fileIo { * * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ WRITE = 2, @@ -8533,7 +8627,8 @@ declare namespace fileIo { * * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ READ = 4, @@ -8542,7 +8637,8 @@ declare namespace fileIo { * * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ READ_WRITE = 6, } @@ -8552,19 +8648,48 @@ declare namespace fileIo { * * @enum { number } access flag type * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - declare enum AccessFlagType { + export enum AccessFlagType { /** * Check if the file is on the local. * * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ LOCAL = 0, } } -// namespace end + +/** + * Task signal. + * @typedef { fileIo.TaskSignal } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 20 + * @arkts 1.2 + */ +export type TaskSignal = fileIo.TaskSignal; + +/** + * The AtomicFile class provides methods for performing atomic operations on files. + * @typedef { fileIo.AtomicFile } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 20 + * @arkts 1.2 + */ +export type AtomicFile = fileIo.AtomicFile; + +/** + * Watcher object + * @typedef { fileIo.Watcher } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 20 + * @arkts 1.2 + */ +export type Watcher = fileIo.Watcher; + /** * Task signal. * @@ -8710,7 +8835,8 @@ export interface WatchEventListener { * * @interface WatchEvent * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface WatchEvent { /** @@ -8719,7 +8845,8 @@ export interface WatchEvent { * @type { string } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly fileName: string; @@ -8729,7 +8856,8 @@ export interface WatchEvent { * @type { number } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly event: number; @@ -8739,7 +8867,8 @@ export interface WatchEvent { * @type { number } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 + * @since {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ readonly cookie: number; } @@ -8800,7 +8929,8 @@ export interface Watcher { * * @interface ReaderIteratorResult * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface ReaderIteratorResult { /** @@ -8808,7 +8938,8 @@ export interface ReaderIteratorResult { * * @type { boolean } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ done: boolean; @@ -8817,7 +8948,8 @@ export interface ReaderIteratorResult { * * @type { string } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ value: string; } @@ -8836,7 +8968,8 @@ export interface ReaderIteratorResult { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface Filter { /** @@ -8853,7 +8986,8 @@ export interface Filter { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ suffix?: Array; /** @@ -8870,7 +9004,8 @@ export interface Filter { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ displayName?: Array; /** @@ -8887,7 +9022,8 @@ export interface Filter { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ mimeType?: Array; /** @@ -8904,7 +9040,8 @@ export interface Filter { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ fileSizeOver?: number; /** @@ -8921,7 +9058,8 @@ export interface Filter { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ lastModifiedAfter?: number; /** @@ -8938,7 +9076,8 @@ export interface Filter { * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ excludeMedia?: boolean; } @@ -8954,7 +9093,8 @@ export interface Filter { * * @interface ConflictFiles * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface ConflictFiles { /** @@ -8969,7 +9109,8 @@ export interface ConflictFiles { * * @type { string } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ srcFile: string; @@ -8985,7 +9126,8 @@ export interface ConflictFiles { * * @type { string } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ destFile: string; } @@ -8995,7 +9137,8 @@ export interface ConflictFiles { * * @interface Options * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface Options { /** @@ -9003,7 +9146,8 @@ export interface Options { * * @type { ?string } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ encoding?: string; } @@ -9014,7 +9158,8 @@ export interface Options { * @interface ReadOptions * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface ReadOptions { /** @@ -9023,7 +9168,8 @@ export interface ReadOptions { * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ offset?: number; /** @@ -9032,7 +9178,8 @@ export interface ReadOptions { * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ length?: number; } @@ -9044,7 +9191,8 @@ export interface ReadOptions { * @interface ReadTextOptions * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface ReadTextOptions extends ReadOptions { /** @@ -9053,7 +9201,8 @@ export interface ReadTextOptions extends ReadOptions { * @type { ?string } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ encoding?: string; } @@ -9065,7 +9214,8 @@ export interface ReadTextOptions extends ReadOptions { * @interface WriteOptions * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface WriteOptions extends Options { /** @@ -9074,7 +9224,8 @@ export interface WriteOptions extends Options { * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ offset?: number; /** @@ -9083,7 +9234,8 @@ export interface WriteOptions extends Options { * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ length?: number; } @@ -9094,7 +9246,8 @@ export interface WriteOptions extends Options { * @interface ListFileOptions * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface ListFileOptions { /** @@ -9103,7 +9256,8 @@ export interface ListFileOptions { * @type { ?boolean } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ recursion?: boolean; @@ -9113,7 +9267,8 @@ export interface ListFileOptions { * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ listNum?: number; @@ -9123,7 +9278,8 @@ export interface ListFileOptions { * @type { ?Filter } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ filter?: Filter; } @@ -9133,7 +9289,8 @@ export interface ListFileOptions { * * @interface RandomAccessFileOptions * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface RandomAccessFileOptions { /** @@ -9141,7 +9298,8 @@ export interface RandomAccessFileOptions { * * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ start?: number; @@ -9150,7 +9308,8 @@ export interface RandomAccessFileOptions { * * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ end?: number; } @@ -9160,7 +9319,8 @@ export interface RandomAccessFileOptions { * * @interface ReadStreamOptions * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface ReadStreamOptions { /** @@ -9168,7 +9328,8 @@ export interface ReadStreamOptions { * * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ start?: number; @@ -9177,7 +9338,8 @@ export interface ReadStreamOptions { * * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ end?: number; } @@ -9187,7 +9349,8 @@ export interface ReadStreamOptions { * * @interface WriteStreamOptions * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface WriteStreamOptions { /** @@ -9195,7 +9358,8 @@ export interface WriteStreamOptions { * * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ mode?: number; /** @@ -9203,7 +9367,8 @@ export interface WriteStreamOptions { * * @type { ?number } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ start?: number; } -- Gitee From 9a320c13406111c7ee571c1df96609359b9b6b40 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Fri, 18 Apr 2025 20:10:36 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: I84bf69a1a0311143605dc3d8bfbc5abddb8b30cd --- api/@ohos.file.fs.d.ts | 150 +++++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 67 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index b117058a35..a363f04d02 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -54,16 +54,18 @@ export default fileIo; * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace fileIo { - /*** if arkts 1.1 */ + + export { connectDfs }; + export { disconnectDfs }; export type { Progress }; export type { CopyOptions }; export type { ProgressListener }; export type { DfsListeners }; - /*** endif */ - + /** * Mode Indicates the open flags. * @@ -2004,8 +2006,7 @@ declare namespace fileIo { * @throws { BusinessError } 13900030 - File name too long * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ export function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; @@ -6422,40 +6423,6 @@ declare namespace fileIo { options?: WriteOptions ): number; - /** - * Connect Distributed File System. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param { string } networkId - The networkId of device. - * @param { DfsListeners } listeners - The listeners of Distributed File System. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13900045 - Connection failed. - * @throws { BusinessError } 13900046 - Software caused connection abort. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - export function connectDfs(networkId: string, listeners: DfsListeners): Promise; - - /** - * Disconnect Distributed File System. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param { string } networkId - The networkId of device. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; - *
2.Incorrect parameter types. - * @throws { BusinessError } 13600004 - Unmount failed. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - export function disconnectDfs(networkId: string): Promise; - /** * Set extended attributes information of the file. * @@ -6613,8 +6580,8 @@ declare namespace fileIo { * * @typedef CopyOptions * @syscap SystemCapability.FileManagement.File.FileIO - * @since {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ export interface CopyOptions { /** @@ -6622,8 +6589,8 @@ declare namespace fileIo { * * @type { ?ProgressListener } * @syscap SystemCapability.FileManagement.File.FileIO - * @since {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ progressListener?: ProgressListener; /** @@ -6631,8 +6598,8 @@ declare namespace fileIo { * * @type { ?TaskSignal } * @syscap SystemCapability.FileManagement.File.FileIO - * @since {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ copySignal?: TaskSignal; } @@ -8506,27 +8473,6 @@ declare namespace fileIo { next(): ReaderIteratorResult; } - // /** - // * The listeners of Distributed File System. - // * - // * @typedef DfsListeners - // * @syscap SystemCapability.FileManagement.File.FileIO - // * @since 12 - // * @arkts 1.1&1.2 - // */ - // export interface DfsListeners { - // /** - // * The Listener of Distributed File System status - // * - // * @param { string } networkId - The networkId of device. - // * @param { number } status - The status code of Distributed File System. - // * @syscap SystemCapability.FileManagement.File.FileIO - // * @since 12 - // * @arkts 1.1&1.2 - // */ - // onStatus(networkId: string, status: number): void; - // } - /** * Enumeration of different types of whence. * @@ -8690,6 +8636,16 @@ export type AtomicFile = fileIo.AtomicFile; */ export type Watcher = fileIo.Watcher; +/** + * Get options of copy + * + * @typedef { fileIo.CopyOptions } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 20 + * @arkts 1.2 + */ +export type CopyOptions = fileIo.CopyOptions; + /** * Task signal. * @@ -8954,6 +8910,33 @@ export interface ReaderIteratorResult { value: string; } +/** + * Get options of copy + * + * @typedef CopyOptions + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ +export interface CopyOptions { + /** + * Listener of copy progress + * + * @type { ?ProgressListener } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 11 + */ + progressListener?: ProgressListener; + /** + * Cancel signal of copy. + * + * @type { ?TaskSignal } + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ + copySignal?: TaskSignal; +} + + /** * File filter type * @@ -9373,6 +9356,39 @@ export interface WriteStreamOptions { start?: number; } +/** + * Connect Distributed File System. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { string } networkId - The networkId of device. + * @param { DfsListeners } listeners - The listeners of Distributed File System. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13900045 - Connection failed. + * @throws { BusinessError } 13900046 - Software caused connection abort. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ +declare function connectDfs(networkId: string, listeners: DfsListeners): Promise; + +/** + * Disconnect Distributed File System. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { string } networkId - The networkId of device. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600004 - Unmount failed. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 12 + */ +declare function disconnectDfs(networkId: string): Promise; + + /** * The listeners of Distributed File System. * -- Gitee From af607d34c73898498fc0837e07597115d98707ce Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Sat, 19 Apr 2025 20:05:28 +0800 Subject: [PATCH 8/9] hash && securityLabel Signed-off-by: zhangxiaoliang25 Change-Id: I02cc6202de153070dd0c557c2eaf5328112d792f --- api/@ohos.file.hash.d.ts | 21 ++++++++++++++------- api/@ohos.file.securityLabel.d.ts | 24 ++++++++++++++++-------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/api/@ohos.file.hash.d.ts b/api/@ohos.file.hash.d.ts index bd9f4e28b3..700e97c301 100644 --- a/api/@ohos.file.hash.d.ts +++ b/api/@ohos.file.hash.d.ts @@ -34,7 +34,8 @@ import stream from './@ohos.util.stream'; * @namespace hash * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace hash { /** @@ -58,7 +59,8 @@ declare namespace hash { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ function hash(path: string, algorithm: string): Promise; @@ -83,7 +85,8 @@ declare namespace hash { * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice - * @since 11 + * @since {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ function hash(path: string, algorithm: string, callback: AsyncCallback): void; @@ -92,7 +95,8 @@ declare namespace hash { * * @extends stream.Transform * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ class HashStream extends stream.Transform { /** @@ -102,7 +106,8 @@ declare namespace hash { * @throws { BusinessError } 401 - Parameter error * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ digest(): string; @@ -113,7 +118,8 @@ declare namespace hash { * @throws { BusinessError } 401 - Parameter error * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ update(data: ArrayBuffer): void; } @@ -127,7 +133,8 @@ declare namespace hash { * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 12 + * @since {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function createHash(algorithm: string): HashStream; } diff --git a/api/@ohos.file.securityLabel.d.ts b/api/@ohos.file.securityLabel.d.ts index 6167dc92ac..50e8b57494 100644 --- a/api/@ohos.file.securityLabel.d.ts +++ b/api/@ohos.file.securityLabel.d.ts @@ -25,7 +25,8 @@ import type { AsyncCallback } from './@ohos.base'; * * @namespace securityLabel * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace securityLabel { /** @@ -33,7 +34,8 @@ declare namespace securityLabel { * * @typedef { 's0' | 's1' | 's2' | 's3' | 's4' } * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ type DataLevel = 's0' | 's1' | 's2' | 's3' | 's4'; @@ -52,7 +54,8 @@ declare namespace securityLabel { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function setSecurityLabel(path: string, type: DataLevel): Promise; @@ -71,7 +74,8 @@ declare namespace securityLabel { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function setSecurityLabel(path: string, type: DataLevel, callback: AsyncCallback): void; @@ -89,7 +93,8 @@ declare namespace securityLabel { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function setSecurityLabelSync(path: string, type: DataLevel): void; @@ -107,7 +112,8 @@ declare namespace securityLabel { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getSecurityLabel(path: string): Promise; @@ -125,7 +131,8 @@ declare namespace securityLabel { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getSecurityLabel(path: string, callback: AsyncCallback): void; @@ -143,7 +150,8 @@ declare namespace securityLabel { * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 + * @since {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getSecurityLabelSync(path: string): string; } -- Gitee From 60f20f80988f09e97fb2d0f10f73b12f825c7708 Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Sun, 20 Apr 2025 15:15:54 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=20export?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: I4b4a9dc2bda14d0836f332ef1fd3d19f5e179282 --- api/@ohos.file.fs.d.ts | 315 ++++++++++++++++++++--------------------- 1 file changed, 154 insertions(+), 161 deletions(-) diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index a363f04d02..9bd22d71bb 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -21,8 +21,6 @@ import { AsyncCallback } from './@ohos.base'; import stream from './@ohos.util.stream'; -export default fileIo; - /** * FileIO * @@ -58,13 +56,6 @@ export default fileIo; * @arkts 1.1&1.2 */ declare namespace fileIo { - - export { connectDfs }; - export { disconnectDfs }; - export type { Progress }; - export type { CopyOptions }; - export type { ProgressListener }; - export type { DfsListeners }; /** * Mode Indicates the open flags. @@ -91,7 +82,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export namespace OpenMode { + namespace OpenMode { /** * Read only Permission. * @@ -404,7 +395,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function access(path: string, mode?: AccessModeType): Promise; + function access(path: string, mode?: AccessModeType): Promise; /** * Access file. @@ -470,7 +461,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function access(path: string, callback: AsyncCallback): void; + function access(path: string, callback: AsyncCallback): void; /** * Access file. @@ -494,7 +485,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise; + function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise; /** * Access file with sync interface. @@ -584,7 +575,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function accessSync(path: string, mode?: AccessModeType): boolean; + function accessSync(path: string, mode?: AccessModeType): boolean; /** * Access file with sync interface. @@ -608,7 +599,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean; + function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean; /** * Close file or fd. @@ -656,7 +647,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function close(file: number | File): Promise; + function close(file: number | File): Promise; /** * Close file or fd. @@ -704,7 +695,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function close(file: number | File, callback: AsyncCallback): void; + function close(file: number | File, callback: AsyncCallback): void; /** * Close file or fd with sync interface. @@ -749,7 +740,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function closeSync(file: number | File): void; + function closeSync(file: number | File): void; /** * Copy file or directory. @@ -825,7 +816,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise; + function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise; /** * Copy file or directory. @@ -863,7 +854,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copy(srcUri: string, destUri: string, callback: AsyncCallback): void; + function copy(srcUri: string, destUri: string, callback: AsyncCallback): void; /** * Copy file or directory. @@ -902,7 +893,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback): void; + function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback): void; /** * Copy directory. @@ -960,7 +951,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyDir(src: string, dest: string, mode?: number): Promise; + function copyDir(src: string, dest: string, mode?: number): Promise; /** * Copy directory. @@ -989,7 +980,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyDir(src: string, dest: string, callback: AsyncCallback): void; + function copyDir(src: string, dest: string, callback: AsyncCallback): void; /** * Copy directory. @@ -1002,7 +993,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyDir(src: string, dest: string, callback: AsyncCallback>): void; + function copyDir(src: string, dest: string, callback: AsyncCallback>): void; /** @@ -1033,7 +1024,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; + function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; /** * Copy directory. @@ -1047,7 +1038,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; + function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; /** * Copy directory with sync interface. @@ -1105,7 +1096,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyDirSync(src: string, dest: string, mode?: number): void; + function copyDirSync(src: string, dest: string, mode?: number): void; /** * Copy file. @@ -1222,7 +1213,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyFile(src: string | number, dest: string | number, mode?: number): Promise; + function copyFile(src: string | number, dest: string | number, mode?: number): Promise; /** * Copy file. @@ -1306,7 +1297,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; + function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; /** * Copy file. @@ -1393,7 +1384,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyFile( + function copyFile( src: string | number, dest: string | number, mode: number, @@ -1511,7 +1502,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function copyFileSync(src: string | number, dest: string | number, mode?: number): void; + function copyFileSync(src: string | number, dest: string | number, mode?: number): void; /** * Create class Stream. @@ -1585,7 +1576,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createStream(path: string, mode: string): Promise; + function createStream(path: string, mode: string): Promise; /** * Create class Stream. @@ -1623,7 +1614,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createStream(path: string, mode: string, callback: AsyncCallback): void; + function createStream(path: string, mode: string, callback: AsyncCallback): void; /** * Create class Stream with sync interface. @@ -1697,7 +1688,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createStreamSync(path: string, mode: string): Stream; + function createStreamSync(path: string, mode: string): Stream; /** @@ -1773,7 +1764,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createRandomAccessFile(file: string | File, mode?: number, + function createRandomAccessFile(file: string | File, mode?: number, options?: RandomAccessFileOptions): Promise; /** @@ -1811,7 +1802,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createRandomAccessFile(file: string | File, callback: AsyncCallback): void; + function createRandomAccessFile(file: string | File, callback: AsyncCallback): void; /** * Create class RandomAccessFile. @@ -1849,7 +1840,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback): void; + function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback): void; /** * Create class RandomAccessFile with sync interface. @@ -1924,7 +1915,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createRandomAccessFileSync(file: string | File, mode?: number, + function createRandomAccessFileSync(file: string | File, mode?: number, options?: RandomAccessFileOptions): RandomAccessFile; /** @@ -1953,7 +1944,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; + function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; /** * Create file write stream. @@ -1983,7 +1974,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; + function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; /** * Create watcher to listen for file changes. @@ -2008,7 +1999,7 @@ declare namespace fileIo { * @syscap SystemCapability.FileManagement.File.FileIO * @since 10 */ - export function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; + function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; /** * Duplicate fd to File Object. @@ -2026,7 +2017,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function dup(fd: number): File; + function dup(fd: number): File; /** * Synchronize file metadata. @@ -2060,7 +2051,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fdatasync(fd: number): Promise; + function fdatasync(fd: number): Promise; /** * Synchronize file metadata. @@ -2094,7 +2085,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fdatasync(fd: number, callback: AsyncCallback): void; + function fdatasync(fd: number, callback: AsyncCallback): void; /** * Synchronize file metadata with sync interface. @@ -2126,7 +2117,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fdatasyncSync(fd: number): void; + function fdatasyncSync(fd: number): void; /** * Create class Stream by using fd. @@ -2165,7 +2156,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fdopenStream(fd: number, mode: string): Promise; + function fdopenStream(fd: number, mode: string): Promise; /** * Create class Stream by using fd. @@ -2204,7 +2195,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; + function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; /** * Create class Stream by using fd with sync interface. @@ -2243,7 +2234,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fdopenStreamSync(fd: number, mode: string): Stream; + function fdopenStreamSync(fd: number, mode: string): Stream; /** * Synchronize file. @@ -2277,7 +2268,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fsync(fd: number): Promise; + function fsync(fd: number): Promise; /** * Synchronize file. @@ -2311,7 +2302,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fsync(fd: number, callback: AsyncCallback): void; + function fsync(fd: number, callback: AsyncCallback): void; /** * Synchronize file with sync interface. @@ -2343,7 +2334,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function fsyncSync(fd: number): void; + function fsyncSync(fd: number): void; /** * List file. @@ -2394,7 +2385,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function listFile( + function listFile( path: string, options?: ListFileOptions ): Promise; @@ -2445,7 +2436,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function listFile(path: string, callback: AsyncCallback): void; + function listFile(path: string, callback: AsyncCallback): void; /** * List file. @@ -2496,7 +2487,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function listFile( + function listFile( path: string, options: ListFileOptions, callback: AsyncCallback @@ -2548,7 +2539,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function listFileSync( + function listFileSync( path: string, options?: ListFileOptions ): string[]; @@ -2585,7 +2576,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function lseek(fd: number, offset: number, whence?: WhenceType): number; + function lseek(fd: number, offset: number, whence?: WhenceType): number; /** * Stat link file. @@ -2606,7 +2597,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function lstat(path: string): Promise; + function lstat(path: string): Promise; /** * Stat link file. @@ -2627,7 +2618,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function lstat(path: string, callback: AsyncCallback): void; + function lstat(path: string, callback: AsyncCallback): void; /** * Stat link file with sync interface. @@ -2648,7 +2639,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function lstatSync(path: string): Stat; + function lstatSync(path: string): Stat; /** * Make dir. @@ -2723,7 +2714,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdir(path: string): Promise; + function mkdir(path: string): Promise; /** * Make dir. @@ -2751,7 +2742,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdir(path: string, recursion: boolean): Promise; + function mkdir(path: string, recursion: boolean): Promise; /** * Make dir. @@ -2826,7 +2817,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdir(path: string, callback: AsyncCallback): void; + function mkdir(path: string, callback: AsyncCallback): void; /** * Make dir. @@ -2854,7 +2845,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdir(path: string, recursion: boolean, callback: AsyncCallback): void; + function mkdir(path: string, recursion: boolean, callback: AsyncCallback): void; /** * Make dir with sync interface. @@ -2926,7 +2917,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdirSync(path: string): void; + function mkdirSync(path: string): void; /** * Make dir with sync interface. @@ -2953,7 +2944,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdirSync(path: string, recursion: boolean): void; + function mkdirSync(path: string, recursion: boolean): void; /** * Make temp dir. @@ -3003,7 +2994,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdtemp(prefix: string): Promise; + function mkdtemp(prefix: string): Promise; /** * Make temp dir. @@ -3053,7 +3044,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdtemp(prefix: string, callback: AsyncCallback): void; + function mkdtemp(prefix: string, callback: AsyncCallback): void; /** * Make temp dir with sync interface. @@ -3103,7 +3094,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function mkdtempSync(prefix: string): string; + function mkdtempSync(prefix: string): string; /** * Move directory. @@ -3135,7 +3126,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveDir(src: string, dest: string, mode?: number): Promise; + function moveDir(src: string, dest: string, mode?: number): Promise; /** * Move directory. @@ -3165,7 +3156,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveDir(src: string, dest: string, callback: AsyncCallback): void; + function moveDir(src: string, dest: string, callback: AsyncCallback): void; /** * Move directory. @@ -3178,7 +3169,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveDir(src: string, dest: string, callback: AsyncCallback>): void; + function moveDir(src: string, dest: string, callback: AsyncCallback>): void; /** * Move directory. @@ -3209,7 +3200,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; + function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; /** * Move directory. @@ -3223,7 +3214,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; + function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; /** * Move directory with sync interface. @@ -3254,7 +3245,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveDirSync(src: string, dest: string, mode?: number): void; + function moveDirSync(src: string, dest: string, mode?: number): void; /** * Move file. @@ -3316,7 +3307,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveFile(src: string, dest: string, mode?: number): Promise; + function moveFile(src: string, dest: string, mode?: number): Promise; /** * Move file. @@ -3376,7 +3367,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveFile(src: string, dest: string, callback: AsyncCallback): void; + function moveFile(src: string, dest: string, callback: AsyncCallback): void; /** * Move file. @@ -3438,7 +3429,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; + function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; /** * Move file with sync interface. @@ -3498,7 +3489,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export function moveFileSync(src: string, dest: string, mode?: number): void; + function moveFileSync(src: string, dest: string, mode?: number): void; /** * Open file. @@ -3647,7 +3638,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function open(path: string, mode?: number): Promise; + function open(path: string, mode?: number): Promise; /** * Open file. @@ -3755,7 +3746,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function open(path: string, callback: AsyncCallback): void; + function open(path: string, callback: AsyncCallback): void; /** * Open file. @@ -3866,7 +3857,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function open(path: string, mode: number, callback: AsyncCallback): void; + function open(path: string, mode: number, callback: AsyncCallback): void; /** * Open file with sync interface. @@ -4015,7 +4006,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function openSync(path: string, mode?: number): File; + function openSync(path: string, mode?: number): File; /** * Read file. @@ -4100,7 +4091,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function read( + function read( fd: number, buffer: ArrayBuffer, options?: ReadOptions @@ -4164,7 +4155,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; + function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; /** * Read file. @@ -4227,7 +4218,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function read( + function read( fd: number, buffer: ArrayBuffer, options: ReadOptions, @@ -4317,7 +4308,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readSync( + function readSync( fd: number, buffer: ArrayBuffer, options?: ReadOptions @@ -4367,7 +4358,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readLines(filePath: string, options?: Options): Promise; + function readLines(filePath: string, options?: Options): Promise; /** * Read content line by line. @@ -4390,7 +4381,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readLines(filePath: string, callback: AsyncCallback): void; + function readLines(filePath: string, callback: AsyncCallback): void; /** * Read content line by line. @@ -4414,7 +4405,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readLines(filePath: string, options: Options, callback: AsyncCallback): void; + function readLines(filePath: string, options: Options, callback: AsyncCallback): void; /** * Read content line by line with sync interface. @@ -4460,7 +4451,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readLinesSync(filePath: string, options?: Options): ReaderIterator; + function readLinesSync(filePath: string, options?: Options): ReaderIterator; /** * Read text. @@ -4557,7 +4548,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readText( + function readText( filePath: string, options?: ReadTextOptions ): Promise; @@ -4629,7 +4620,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readText(filePath: string, callback: AsyncCallback): void; + function readText(filePath: string, callback: AsyncCallback): void; /** * Read text. @@ -4701,7 +4692,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readText( + function readText( filePath: string, options: ReadTextOptions, callback: AsyncCallback @@ -4802,7 +4793,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function readTextSync( + function readTextSync( filePath: string, options?: ReadTextOptions ): string; @@ -4895,7 +4886,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function rename(oldPath: string, newPath: string): Promise; + function rename(oldPath: string, newPath: string): Promise; /** * Rename file. @@ -4985,7 +4976,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; + function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; /** * Rename file with sync interface. @@ -5072,7 +5063,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function renameSync(oldPath: string, newPath: string): void; + function renameSync(oldPath: string, newPath: string): void; /** * Delete dir. @@ -5138,7 +5129,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function rmdir(path: string): Promise; + function rmdir(path: string): Promise; /** * Delete dir. @@ -5204,7 +5195,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function rmdir(path: string, callback: AsyncCallback): void; + function rmdir(path: string, callback: AsyncCallback): void; /** * Delete dir with sync interface. @@ -5267,7 +5258,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function rmdirSync(path: string): void; + function rmdirSync(path: string): void; /** * Get file information. @@ -5336,7 +5327,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function stat(file: string | number): Promise; + function stat(file: string | number): Promise; /** * Get file information. @@ -5405,7 +5396,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function stat(file: string | number, callback: AsyncCallback): void; + function stat(file: string | number, callback: AsyncCallback): void; /** * Get file information with sync interface. @@ -5474,7 +5465,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function statSync(file: string | number): Stat; + function statSync(file: string | number): Stat; /** * Link file. @@ -5500,7 +5491,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function symlink(target: string, srcPath: string): Promise; + function symlink(target: string, srcPath: string): Promise; /** * Link file. @@ -5526,7 +5517,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function symlink(target: string, srcPath: string, callback: AsyncCallback): void; + function symlink(target: string, srcPath: string, callback: AsyncCallback): void; /** * Link file with sync interface. @@ -5551,7 +5542,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export function symlinkSync(target: string, srcPath: string): void; + function symlinkSync(target: string, srcPath: string): void; /** * Truncate file. @@ -5632,7 +5623,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function truncate(file: string | number, len?: number): Promise; + function truncate(file: string | number, len?: number): Promise; /** * Truncate file. @@ -5710,7 +5701,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function truncate(file: string | number, callback: AsyncCallback): void; + function truncate(file: string | number, callback: AsyncCallback): void; /** * Truncate file. @@ -5791,7 +5782,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function truncate(file: string | number, len: number, callback: AsyncCallback): void; + function truncate(file: string | number, len: number, callback: AsyncCallback): void; /** * Truncate file with sync interface. @@ -5869,7 +5860,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function truncateSync(file: string | number, len?: number): void; + function truncateSync(file: string | number, len?: number): void; /** * Delete file. @@ -5944,7 +5935,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function unlink(path: string): Promise; + function unlink(path: string): Promise; /** * Delete file. @@ -6019,7 +6010,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function unlink(path: string, callback: AsyncCallback): void; + function unlink(path: string, callback: AsyncCallback): void; /** * Delete file with sync interface. @@ -6091,7 +6082,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function unlinkSync(path: string): void; + function unlinkSync(path: string): void; /** * Change file mtime. @@ -6123,7 +6114,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function utimes(path: string, mtime: number): void; + function utimes(path: string, mtime: number): void; /** * Write file. @@ -6195,7 +6186,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function write( + function write( fd: number, buffer: ArrayBuffer | string, options?: WriteOptions @@ -6268,7 +6259,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; + function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; /** * Write file. @@ -6340,7 +6331,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function write( + function write( fd: number, buffer: ArrayBuffer | string, options: WriteOptions, @@ -6417,7 +6408,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export function writeSync( + function writeSync( fd: number, buffer: ArrayBuffer | string, options?: WriteOptions @@ -6445,7 +6436,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function setxattr(path: string, key: string, value: string): Promise; + function setxattr(path: string, key: string, value: string): Promise; /** * Set extended attributes information of the file. @@ -6468,7 +6459,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function setxattrSync(path: string, key: string, value: string): void; + function setxattrSync(path: string, key: string, value: string): void; /** * Get extended attributes information of the file. @@ -6489,7 +6480,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function getxattr(path: string, key: string): Promise; + function getxattr(path: string, key: string): Promise; /** * Get extended attributes information of the file with sync interface. @@ -6510,7 +6501,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export function getxattrSync(path: string, key: string): string; + function getxattrSync(path: string, key: string): string; // function end /** @@ -6521,7 +6512,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export interface Progress { + interface Progress { /** * @type { number } * @readonly @@ -6548,7 +6539,7 @@ declare namespace fileIo { * @since 20 * @arkts 1.2 */ - export class TaskSignal { + class TaskSignal { /** * Cancel the copy task in progress. * @@ -6583,7 +6574,7 @@ declare namespace fileIo { * @since 20 * @arkts 1.2 */ - export interface CopyOptions { + interface CopyOptions { /** * Listener of copy progress * @@ -6613,7 +6604,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export type ProgressListener = (progress: Progress) => void; + type ProgressListener = (progress: Progress) => void; /** * File object. @@ -6640,7 +6631,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export interface File { + interface File { /** * @type { number } * @readonly @@ -6795,7 +6786,7 @@ declare namespace fileIo { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - export interface RandomAccessFile { + interface RandomAccessFile { /** * File descriptor @@ -7243,7 +7234,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export class ReadStream extends stream.Readable { + class ReadStream extends stream.Readable { /** * The ReadStream constructor. * @@ -7317,7 +7308,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export class WriteStream extends stream.Writable { + class WriteStream extends stream.Writable { /** * The WriteStream constructor. * @@ -7389,7 +7380,7 @@ declare namespace fileIo { * @since 20 * @arkts 1.2 */ - export class AtomicFile { + class AtomicFile { /** * The AtomicFile constructor. * @param { string } path file path. @@ -7508,7 +7499,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export interface Stat { + interface Stat { /** * @type { bigint } * @readonly @@ -7929,7 +7920,7 @@ declare namespace fileIo { * @since {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - export interface Stream { + interface Stream { /** * Close stream. * @@ -8404,7 +8395,7 @@ declare namespace fileIo { * @since 20 * @arkts 1.2 */ - export interface Watcher { + interface Watcher { /** * Start watcher. * @@ -8458,7 +8449,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export interface ReaderIterator { + interface ReaderIterator { /** * Get next result from the iterator. * @@ -8481,7 +8472,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export enum WhenceType { + enum WhenceType { /** * Starting position of the file offset. * @@ -8518,7 +8509,7 @@ declare namespace fileIo { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - export enum LocationType { + enum LocationType { /** * Local file. * @@ -8547,7 +8538,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export enum AccessModeType { + enum AccessModeType { /** * Check if the file exists. * @@ -8597,7 +8588,7 @@ declare namespace fileIo { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - export enum AccessFlagType { + enum AccessFlagType { /** * Check if the file is on the local. * @@ -8616,7 +8607,7 @@ declare namespace fileIo { * @since 20 * @arkts 1.2 */ -export type TaskSignal = fileIo.TaskSignal; +type TaskSignal = fileIo.TaskSignal; /** * The AtomicFile class provides methods for performing atomic operations on files. @@ -8625,7 +8616,7 @@ export type TaskSignal = fileIo.TaskSignal; * @since 20 * @arkts 1.2 */ -export type AtomicFile = fileIo.AtomicFile; +type AtomicFile = fileIo.AtomicFile; /** * Watcher object @@ -8634,7 +8625,7 @@ export type AtomicFile = fileIo.AtomicFile; * @since 20 * @arkts 1.2 */ -export type Watcher = fileIo.Watcher; +type Watcher = fileIo.Watcher; /** * Get options of copy @@ -8644,7 +8635,7 @@ export type Watcher = fileIo.Watcher; * @since 20 * @arkts 1.2 */ -export type CopyOptions = fileIo.CopyOptions; +type CopyOptions = fileIo.CopyOptions; /** * Task signal. @@ -8652,7 +8643,7 @@ export type CopyOptions = fileIo.CopyOptions; * @syscap SystemCapability.FileManagement.File.FileIO * @since 12 */ -export class TaskSignal { +class TaskSignal { /** * Cancel the copy task in progress. * @@ -8682,7 +8673,7 @@ export class TaskSignal { * @syscap SystemCapability.FileManagement.File.FileIO * @since 15 */ -export class AtomicFile { +class AtomicFile { /** * The AtomicFile constructor. * @param { string } path file path. @@ -8775,7 +8766,7 @@ export class AtomicFile { * @syscap SystemCapability.FileManagement.File.FileIO * @since 10 */ -export interface WatchEventListener { +interface WatchEventListener { /** * Specifies the callback function to be invoked. * @@ -8794,7 +8785,7 @@ export interface WatchEventListener { * @since {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface WatchEvent { +interface WatchEvent { /** * File name. * @@ -8836,7 +8827,7 @@ export interface WatchEvent { * @syscap SystemCapability.FileManagement.File.FileIO * @since 10 */ -export interface Watcher { +interface Watcher { /** * Start watcher. * @@ -8888,7 +8879,7 @@ export interface Watcher { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface ReaderIteratorResult { +interface ReaderIteratorResult { /** * Whether reader iterator completes the traversal. * @@ -8917,7 +8908,7 @@ export interface ReaderIteratorResult { * @syscap SystemCapability.FileManagement.File.FileIO * @since 11 */ -export interface CopyOptions { +interface CopyOptions { /** * Listener of copy progress * @@ -8954,7 +8945,7 @@ export interface CopyOptions { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface Filter { +interface Filter { /** * The suffix of the file. * @@ -9079,7 +9070,7 @@ export interface Filter { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface ConflictFiles { +interface ConflictFiles { /** * The path of the source file. * @@ -9123,7 +9114,7 @@ export interface ConflictFiles { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface Options { +interface Options { /** * The encoding style. * @@ -9144,7 +9135,7 @@ export interface Options { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface ReadOptions { +interface ReadOptions { /** * The offset when reading the file. * @@ -9177,7 +9168,7 @@ export interface ReadOptions { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface ReadTextOptions extends ReadOptions { +interface ReadTextOptions extends ReadOptions { /** * The encoding style when reading text. * @@ -9200,7 +9191,7 @@ export interface ReadTextOptions extends ReadOptions { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface WriteOptions extends Options { +interface WriteOptions extends Options { /** * The offset when writing the file. * @@ -9232,7 +9223,7 @@ export interface WriteOptions extends Options { * @since {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface ListFileOptions { +interface ListFileOptions { /** * Whether to recursively list files. * @@ -9275,7 +9266,7 @@ export interface ListFileOptions { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface RandomAccessFileOptions { +interface RandomAccessFileOptions { /** * The starting position of file offset. * @@ -9305,7 +9296,7 @@ export interface RandomAccessFileOptions { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface ReadStreamOptions { +interface ReadStreamOptions { /** * The starting range for reading a file by stream. * @@ -9335,7 +9326,7 @@ export interface ReadStreamOptions { * @since {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ -export interface WriteStreamOptions { +interface WriteStreamOptions { /** * The mode for creating write stream. * @@ -9396,7 +9387,7 @@ declare function disconnectDfs(networkId: string): Promise; * @syscap SystemCapability.FileManagement.File.FileIO * @since 12 */ -export interface DfsListeners { +interface DfsListeners { /** * The Listener of Distributed File System status * @@ -9407,3 +9398,5 @@ export interface DfsListeners { */ onStatus(networkId: string, status: number): void; } + +export default fileIo; \ No newline at end of file -- Gitee