From 5b76525fc1a46047cf66752af23c0d53778fd54a Mon Sep 17 00:00:00 2001 From: yangbiao59 Date: Fri, 18 Jul 2025 03:02:53 +0000 Subject: [PATCH 1/2] =?UTF-8?q?number=E8=BD=ACint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tianp Change-Id: Icc2bcb3e06a8410d348afcbc2911398eff3fbb16 --- api/@ohos.file.fs.d.ets | 467 ++++++++++++++++++------------------ api/@ohos.file.statvfs.d.ts | 36 +-- 2 files changed, 251 insertions(+), 252 deletions(-) diff --git a/api/@ohos.file.fs.d.ets b/api/@ohos.file.fs.d.ets index 86c718a005..b88ed76a08 100644 --- a/api/@ohos.file.fs.d.ets +++ b/api/@ohos.file.fs.d.ets @@ -265,7 +265,7 @@ function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): b /** * Close file or fd. * - * @param { number | File } file - file object or fd. + * @param { int | 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 @@ -278,12 +278,12 @@ function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): b * @atomicservice * @since 20 */ -function close(file: number | File): Promise; +function close(file: int | File): Promise; /** * Close file or fd. * - * @param { number | File } file - file object or fd. + * @param { int | 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 @@ -296,12 +296,12 @@ function close(file: number | File): Promise; * @atomicservice * @since 20 */ -function close(file: number | File, callback: AsyncCallback): void; +function close(file: int | File, callback: AsyncCallback): void; /** * Close file or fd with sync interface. * - * @param { number | File } file - file object or fd. + * @param { int | File } file - file object or fd. * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor @@ -313,7 +313,7 @@ function close(file: number | File, callback: AsyncCallback): void; * @atomicservice * @since 20 */ -function closeSync(file: number | File): void; +function closeSync(file: int | File): void; /** * Copy file or directory. @@ -434,7 +434,7 @@ function copy(srcUri: string, destUri: string, options: CopyOptions, callback: A * * @param { string } src - source path. * @param { string } dest - destination path. - * @param { number } [mode = 0] - mode. + * @param { int } [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 @@ -457,7 +457,7 @@ function copy(srcUri: string, destUri: string, options: CopyOptions, callback: A * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function copyDir(src: string, dest: string, mode?: number): Promise; +function copyDir(src: string, dest: string, mode?: int): Promise; /** * Copy directory. @@ -504,7 +504,7 @@ function copyDir(src: string, dest: string, callback: AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call @@ -526,27 +526,27 @@ function copyDir(src: string, dest: string, callback: AsyncCallback): void; +function copyDir(src: string, dest: string, mode: int, callback: AsyncCallback): void; /** * Copy directory. * * @param { string } src - source path. * @param { string } dest - destination path. - * @param { number } mode - mode. + * @param { int } mode - mode. * @param { AsyncCallback> } callback - Return the callback function. * @throws { BusinessError } 13900015 - File exists * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; +function copyDir(src: string, dest: string, mode: int, callback: AsyncCallback>): void; /** * Copy directory with sync interface. * * @param { string } src - source path. * @param { string } dest - destination path. - * @param { number } [mode = 0] - mode. + * @param { int } [mode = 0] - mode. * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -569,14 +569,14 @@ function copyDir(src: string, dest: string, mode: number, callback: AsyncCallbac * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function copyDirSync(src: string, dest: string, mode?: number): void; +function copyDirSync(src: string, dest: string, mode?: int): void; /** * Copy file. * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. + * @param { string | int } src - src. + * @param { string | int } dest - dest. + * @param { int } [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 @@ -601,13 +601,13 @@ function copyDirSync(src: string, dest: string, mode?: number): void; * @atomicservice * @since 20 */ -function copyFile(src: string | number, dest: string | number, mode?: number): Promise; +function copyFile(src: string | int, dest: string | int, mode?: int): Promise; /** * Copy file. * - * @param { string | number } src - src. - * @param { string | number } dest - dest. + * @param { string | int } src - src. + * @param { string | int } dest - dest. * @param { AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call @@ -631,14 +631,14 @@ function copyFile(src: string | number, dest: string | number, mode?: number): P * @atomicservice * @since 20 */ -function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; +function copyFile(src: string | int, dest: string | int, callback: AsyncCallback): void; /** * Copy file. * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. + * @param { string | int } src - src. + * @param { string | int } dest - dest. + * @param { int } [mode = 0] - mode. * @param { AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call @@ -663,18 +663,18 @@ function copyFile(src: string | number, dest: string | number, callback: AsyncCa * @since 20 */ function copyFile( - src: string | number, - dest: string | number, - mode: number, + src: string | int, + dest: string | int, + mode: int, callback: AsyncCallback ): void; /** * Copy file with sync interface. * - * @param { string | number } src - src. - * @param { string | number } dest - dest. - * @param { number } [mode = 0] - mode. + * @param { string | int } src - src. + * @param { string | int } dest - dest. + * @param { int } [mode = 0] - mode. * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -698,7 +698,7 @@ function copyFile( * @atomicservice * @since 20 */ -function copyFileSync(src: string | number, dest: string | number, mode?: number): void; +function copyFileSync(src: string | int, dest: string | int, mode?: int): void; /** * Create class Stream. @@ -817,7 +817,7 @@ function createStreamSync(path: string, mode: string): Stream; * Create class RandomAccessFile. * * @param { string | File } file - file path, object. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { int } [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 @@ -850,7 +850,7 @@ function createStreamSync(path: string, mode: string): Stream; * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function createRandomAccessFile(file: string | File, mode?: number, +function createRandomAccessFile(file: string | File, mode?: int, options?: RandomAccessFileOptions): Promise; /** @@ -893,7 +893,7 @@ function createRandomAccessFile(file: string | File, callback: 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 @@ -924,13 +924,13 @@ function createRandomAccessFile(file: string | File, callback: AsyncCallback): void; +function createRandomAccessFile(file: string | File, mode: int, callback: AsyncCallback): void; /** * Create class RandomAccessFile with sync interface. * * @param { string | File } file - file path, object. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { int } [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 @@ -963,7 +963,7 @@ function createRandomAccessFile(file: string | File, mode: number, callback: Asy * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function createRandomAccessFileSync(file: string | File, mode?: number, +function createRandomAccessFileSync(file: string | File, mode?: int, options?: RandomAccessFileOptions): RandomAccessFile; /** @@ -1026,7 +1026,7 @@ function createWriteStream(path: string, options?: WriteStreamOptions): WriteStr * Create watcher to listen for file changes. * * @param { string } path - path. - * @param { number } events - listened events. + * @param { int } 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 @@ -1045,12 +1045,12 @@ function createWriteStream(path: string, options?: WriteStreamOptions): WriteStr * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; +function createWatcher(path: string, events: int, listener: WatchEventListener): Watcher; /** * Duplicate fd to File Object. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @returns { File } return File * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -1062,12 +1062,12 @@ function createWatcher(path: string, events: number, listener: WatchEventListene * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function dup(fd: number): File; +function dup(fd: int): File; /** * Synchronize file metadata. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor @@ -1080,12 +1080,12 @@ function dup(fd: number): File; * @crossplatform * @since 20 */ -function fdatasync(fd: number): Promise; +function fdatasync(fd: int): Promise; /** * Synchronize file metadata. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @param { AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor @@ -1098,12 +1098,12 @@ function fdatasync(fd: number): Promise; * @crossplatform * @since 20 */ -function fdatasync(fd: number, callback: AsyncCallback): void; +function fdatasync(fd: int, callback: AsyncCallback): void; /** * Synchronize file metadata with sync interface. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor * @throws { BusinessError } 13900020 - Invalid argument @@ -1115,12 +1115,12 @@ function fdatasync(fd: number, callback: AsyncCallback): void; * @crossplatform * @since 20 */ -function fdatasyncSync(fd: number): void; +function fdatasyncSync(fd: int): void; /** * Create class Stream by using fd. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @param { string } mode - mode. * @returns { Promise } Returns the Stream object in promise mode. * @throws { BusinessError } 13900001 - Operation not permitted @@ -1153,12 +1153,12 @@ function fdatasyncSync(fd: number): void; * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function fdopenStream(fd: number, mode: string): Promise; +function fdopenStream(fd: int, mode: string): Promise; /** * Create class Stream by using fd. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @param { string } mode - mode. * @param { AsyncCallback } callback - The callback is used to return the Stream object. * @throws { BusinessError } 13900001 - Operation not permitted @@ -1191,12 +1191,12 @@ function fdopenStream(fd: number, mode: string): Promise; * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; +function fdopenStream(fd: int, mode: string, callback: AsyncCallback): void; /** * Create class Stream by using fd with sync interface. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @param { string } mode - mode. * @returns { Stream } Returns the Stream object. * @throws { BusinessError } 13900001 - Operation not permitted @@ -1229,12 +1229,12 @@ function fdopenStream(fd: number, mode: string, callback: AsyncCallback) * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function fdopenStreamSync(fd: number, mode: string): Stream; +function fdopenStreamSync(fd: int, mode: string): Stream; /** * Synchronize file. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor @@ -1247,12 +1247,12 @@ function fdopenStreamSync(fd: number, mode: string): Stream; * @crossplatform * @since 20 */ -function fsync(fd: number): Promise; +function fsync(fd: int): Promise; /** * Synchronize file. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @param { AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor @@ -1265,12 +1265,12 @@ function fsync(fd: number): Promise; * @crossplatform * @since 20 */ -function fsync(fd: number, callback: AsyncCallback): void; +function fsync(fd: int, callback: AsyncCallback): void; /** * Synchronize file with sync interface. * - * @param { number } fd - fd. + * @param { int } fd - fd. * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor * @throws { BusinessError } 13900020 - Invalid argument @@ -1282,7 +1282,7 @@ function fsync(fd: number, callback: AsyncCallback): void; * @crossplatform * @since 20 */ -function fsyncSync(fd: number): void; +function fsyncSync(fd: int): void; /** * List file. @@ -1371,10 +1371,10 @@ function listFileSync( /** * Reposition file offset. * - * @param { number } fd - file descriptor. - * @param { number } offset - file offset. + * @param { int } fd - file descriptor. + * @param { long } offset - file offset. * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. - * @returns { number } Returns the file offset relative to starting position of file. + * @returns { long } 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 @@ -1384,7 +1384,7 @@ function listFileSync( * @crossplatform * @since 20 */ -function lseek(fd: number, offset: number, whence?: WhenceType): number; +function lseek(fd: int, offset: long, whence?: WhenceType): long; /** * Stat link file. @@ -1692,7 +1692,7 @@ function mkdtempSync(prefix: string): string; * * @param { string } src - source file path. * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @param { int } [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 @@ -1716,7 +1716,7 @@ function mkdtempSync(prefix: string): string; * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function moveDir(src: string, dest: string, mode?: number): Promise; +function moveDir(src: string, dest: string, mode?: int): Promise; /** * Move directory. @@ -1764,7 +1764,7 @@ function moveDir(src: string, dest: string, callback: AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900001 - Operation not permitted * @throws { BusinessError } 13900002 - No such file or directory @@ -1787,27 +1787,27 @@ function moveDir(src: string, dest: string, callback: AsyncCallback): void; +function moveDir(src: string, dest: string, mode: int, 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 { int } 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 20 */ -function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback>): void; +function moveDir(src: string, dest: string, mode: int, 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. + * @param { int } [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 @@ -1830,14 +1830,14 @@ function moveDir(src: string, dest: string, mode: number, callback: AsyncCallbac * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ -function moveDirSync(src: string, dest: string, mode?: number): void; +function moveDirSync(src: string, dest: string, mode?: int): 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 { int } [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 @@ -1862,7 +1862,7 @@ function moveDirSync(src: string, dest: string, mode?: number): void; * @crossplatform * @since 20 */ -function moveFile(src: string, dest: string, mode?: number): Promise; +function moveFile(src: string, dest: string, mode?: int): Promise; /** * Move file. @@ -1900,7 +1900,7 @@ function moveFile(src: string, dest: string, callback: AsyncCallback): voi * * @param { string } src - source file path. * @param { string } dest - destination file path. - * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @param { int } [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 @@ -1925,14 +1925,14 @@ function moveFile(src: string, dest: string, callback: AsyncCallback): voi * @crossplatform * @since 20 */ -function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; +function moveFile(src: string, dest: string, mode: int, 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. + * @param { int } [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 @@ -1956,13 +1956,13 @@ function moveFile(src: string, dest: string, mode: number, callback: AsyncCallba * @crossplatform * @since 20 */ -function moveFileSync(src: string, dest: string, mode?: number): void; +function moveFileSync(src: string, dest: string, mode?: int): void; /** * Open file. * * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { int } [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 @@ -1996,7 +1996,7 @@ function moveFileSync(src: string, dest: string, mode?: number): void; * @atomicservice * @since 20 */ -function open(path: string, mode?: number): Promise; +function open(path: string, mode?: int): Promise; /** * Open file. @@ -2040,7 +2040,7 @@ function open(path: string, callback: AsyncCallback): void; * Open file. * * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { int } [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 @@ -2073,13 +2073,13 @@ function open(path: string, callback: AsyncCallback): void; * @atomicservice * @since 20 */ -function open(path: string, mode: number, callback: AsyncCallback): void; +function open(path: string, mode: int, callback: AsyncCallback): void; /** * Open file with sync interface. * * @param { string } path - path. - * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { int } [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 @@ -2113,15 +2113,15 @@ function open(path: string, mode: number, callback: AsyncCallback): void; * @atomicservice * @since 20 */ -function openSync(path: string, mode?: number): File; +function openSync(path: string, mode?: int): File; /** * Read file. * - * @param { number } fd - file descriptor. + * @param { int } 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. + * @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 @@ -2138,17 +2138,17 @@ function openSync(path: string, mode?: number): File; * @since 20 */ function read( - fd: number, + fd: int, buffer: ArrayBuffer, options?: ReadOptions -): Promise; +): Promise; /** * Read file. * - * @param { number } fd - file descriptor. + * @param { int } fd - file descriptor. * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to 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 @@ -2163,15 +2163,15 @@ function read( * @atomicservice * @since 20 */ -function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; +function read(fd: int, buffer: ArrayBuffer, callback: AsyncCallback): void; /** * Read file. * - * @param { number } fd - file descriptor. + * @param { int } 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. + * @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 @@ -2187,19 +2187,19 @@ function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): * @since 20 */ function read( - fd: number, + fd: int, buffer: ArrayBuffer, options: ReadOptions, - callback: AsyncCallback + callback: AsyncCallback ): void; /** * Read file with sync interface. * - * @param { number } fd - file descriptor. + * @param { int } fd - file descriptor. * @param { ArrayBuffer } buffer - buffer. * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. + * @returns { long } 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 @@ -2216,10 +2216,10 @@ function read( * @since 20 */ function readSync( - fd: number, + fd: int, buffer: ArrayBuffer, options?: ReadOptions -): number; +): long; /** * Read content line by line. @@ -2598,7 +2598,7 @@ function rmdirSync(path: string): void; /** * Get file information. * - * @param { string | number } file - path or file descriptor. + * @param { string | int } 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 @@ -2618,12 +2618,12 @@ function rmdirSync(path: string): void; * @atomicservice * @since 20 */ -function stat(file: string | number): Promise; +function stat(file: string | int): Promise; /** * Get file information. * - * @param { string | number } file - path or file descriptor. + * @param { string | int } 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 @@ -2643,12 +2643,12 @@ function stat(file: string | number): Promise; * @atomicservice * @since 20 */ -function stat(file: string | number, callback: AsyncCallback): void; +function stat(file: string | int, callback: AsyncCallback): void; /** * Get file information with sync interface. * - * @param { string | number } file - path or file descriptor. + * @param { string | int } 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 @@ -2668,7 +2668,7 @@ function stat(file: string | number, callback: AsyncCallback): void; * @atomicservice * @since 20 */ -function statSync(file: string | number): Stat; +function statSync(file: string | int): Stat; /** * Link file. @@ -2747,8 +2747,8 @@ function symlinkSync(target: string, srcPath: string): void; /** * Truncate file. * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. + * @param { string | int } file - path or file descriptor. + * @param { long } [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 @@ -2771,12 +2771,12 @@ function symlinkSync(target: string, srcPath: string): void; * @atomicservice * @since 20 */ -function truncate(file: string | number, len?: number): Promise; +function truncate(file: string | int, len?: long): Promise; /** * Truncate file. * - * @param { string | number } file - path or file descriptor. + * @param { string | int } 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 @@ -2799,13 +2799,12 @@ function truncate(file: string | number, len?: number): Promise; * @atomicservice * @since 20 */ -function truncate(file: string | number, callback: AsyncCallback): void; +function truncate(file: string | int, callback: AsyncCallback): void; /** * Truncate file. * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. + * @param { long } [len = 0] - len. * @param { AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900001 - Operation not permitted * @throws { BusinessError } 13900002 - No such file or directory @@ -2828,13 +2827,13 @@ function truncate(file: string | number, callback: AsyncCallback): void; * @atomicservice * @since 20 */ -function truncate(file: string | number, len: number, callback: AsyncCallback): void; +function truncate(file: string | int, len: long, callback: AsyncCallback): void; /** * Truncate file with sync interface. * - * @param { string | number } file - path or file descriptor. - * @param { number } [len = 0] - len. + * @param { string | int } file - path or file descriptor. + * @param { long } [len = 0] - len. * @throws { BusinessError } 13900001 - Operation not permitted * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call @@ -2856,7 +2855,7 @@ function truncate(file: string | number, len: number, callback: AsyncCallback } Returns the number of bytes written to the file in promise mode. + * @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 @@ -2980,17 +2979,17 @@ function utimes(path: string, mtime: number): void; * @since 20 */ function write( - fd: number, + fd: int, buffer: ArrayBuffer | string, options?: WriteOptions -): Promise; +): Promise; /** * Write file. * - * @param { number } fd - file descriptor. + * @param { int } 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. + * @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 @@ -3008,15 +3007,15 @@ function write( * @atomicservice * @since 20 */ -function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; +function write(fd: int, buffer: ArrayBuffer | string, callback: AsyncCallback): void; /** * Write file. * - * @param { number } fd - file descriptor. + * @param { int } 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. + * @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 @@ -3035,19 +3034,19 @@ function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback * @since 20 */ function write( - fd: number, + fd: int, buffer: ArrayBuffer | string, options: WriteOptions, - callback: AsyncCallback + callback: AsyncCallback ): void; /** * Write file with sync interface. * - * @param { number } fd - file descriptor. + * @param { int } fd - file descriptor. * @param { ArrayBuffer | string } buffer - buffer. * @param { WriteOptions } [options] - options. - * @returns { number } Returns the number of bytes written to the file. + * @returns { long } 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 @@ -3066,10 +3065,10 @@ function write( * @since 20 */ function writeSync( - fd: number, + fd: int, buffer: ArrayBuffer | string, options?: WriteOptions -): number; +): long; /** * Connect Distributed File System. @@ -3198,20 +3197,20 @@ function getxattrSync(path: string, key: string): string; */ interface Progress { /** - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly processedSize: number; + readonly processedSize: long; /** - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly totalSize: number; + readonly totalSize: long; } /** @@ -3293,14 +3292,14 @@ type ProgressListener = (progress: Progress) => void; interface File { /** - * @type { number } + * @type { int } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 20 */ - readonly fd: number; + readonly fd: int; /** * File path @@ -3431,27 +3430,27 @@ interface RandomAccessFile { /** * File descriptor * - * @type { number } + * @type { int } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly fd: number; + readonly fd: int; /** * File pointer * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly filePointer: number; + readonly filePointer: long; /** * Set file pointer. * - * @param { number } filePointer - filePointer. + * @param { long } filePointer - filePointer. * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900008 - Bad file descriptor @@ -3460,7 +3459,7 @@ interface RandomAccessFile { * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - setFilePointer(filePointer: number): void; + setFilePointer(filePointer: long): void; /** * Close randomAccessFile with sync interface. @@ -3481,7 +3480,7 @@ interface RandomAccessFile { * * @param { ArrayBuffer | string } buffer - buffer. * @param { WriteOptions } [options] - options. - * @returns { Promise } Returns the number of bytes written to the file in promise mode. + * @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 @@ -3500,13 +3499,13 @@ interface RandomAccessFile { write( buffer: ArrayBuffer | string, options?: WriteOptions - ): Promise; + ): 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. + * @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 @@ -3522,14 +3521,14 @@ interface RandomAccessFile { * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; + write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; /** * 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. + * @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 @@ -3548,7 +3547,7 @@ interface RandomAccessFile { write( buffer: ArrayBuffer | string, options: WriteOptions, - callback: AsyncCallback + callback: AsyncCallback ): void; /** @@ -3556,7 +3555,7 @@ interface RandomAccessFile { * * @param { ArrayBuffer | string } buffer - buffer. * @param { WriteOptions } [options] - options. - * @returns { number } Returns the number of bytes written to the file. + * @returns { long } 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 @@ -3575,14 +3574,14 @@ interface RandomAccessFile { writeSync( buffer: ArrayBuffer | string, options?: WriteOptions - ): number; + ): long; /** * Read randomAccessFile. * * @param { ArrayBuffer } buffer - buffer. * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @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 @@ -3599,13 +3598,13 @@ interface RandomAccessFile { read( buffer: ArrayBuffer, options?: ReadOptions - ): Promise; + ): Promise; /** * Read randomAccessFile. * * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to 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 @@ -3618,14 +3617,14 @@ interface RandomAccessFile { * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - read(buffer: ArrayBuffer, callback: AsyncCallback): void; + read(buffer: ArrayBuffer, callback: AsyncCallback): void; /** * 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. + * @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 @@ -3641,7 +3640,7 @@ interface RandomAccessFile { read( buffer: ArrayBuffer, options: ReadOptions, - callback: AsyncCallback + callback: AsyncCallback ): void; /** @@ -3649,7 +3648,7 @@ interface RandomAccessFile { * * @param { ArrayBuffer } buffer - buffer. * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to buffer. + * @returns { long } 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 @@ -3666,7 +3665,7 @@ interface RandomAccessFile { readSync( buffer: ArrayBuffer, options?: ReadOptions - ): number; + ): long; /** * Generate read stream from RandomAccessFile object. @@ -3718,13 +3717,13 @@ class ReadStream extends stream.Readable { /** * The Number of bytes read in the stream. * - * @type { number } + * @type { long } * @readonly * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly bytesRead: number; + readonly bytesRead: long; /** * The path of the file being read. @@ -3740,9 +3739,9 @@ class ReadStream extends stream.Readable { /** * Set the file position indicator for the read stream. * - * @param { number } offset - file offset. + * @param { long } offset - file offset. * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. - * @returns { number } Returns the offset relative to starting position of stream. + * @returns { long } Returns the offset relative to starting position of stream. * @throws { BusinessError } 401 - Parameter error * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 13900026 - Illegal seek @@ -3750,7 +3749,7 @@ class ReadStream extends stream.Readable { * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - seek(offset: number, whence?: WhenceType): number; + seek(offset: long, whence?: WhenceType): long; /** * Close ReadStream with sync interface. @@ -3786,13 +3785,13 @@ class WriteStream extends stream.Writable { /** * The Number of bytes written in the stream. * - * @type { number } + * @type { long } * @readonly * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly bytesWritten: number; + readonly bytesWritten: long; /** * The path of the file being written. @@ -3808,9 +3807,9 @@ class WriteStream extends stream.Writable { /** * Set the file position indicator for the write stream. * - * @param { number } offset - file offset. + * @param { long } offset - file offset. * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. - * @returns { number } Returns the offset relative to starting position of stream. + * @returns { long } Returns the offset relative to starting position of stream. * @throws { BusinessError } 401 - Parameter error * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 13900026 - Illegal seek @@ -3818,7 +3817,7 @@ class WriteStream extends stream.Writable { * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - seek(offset: number, whence?: WhenceType): number; + seek(offset: long, whence?: WhenceType): long; /** * Close WriteStream with sync interface. @@ -3949,7 +3948,7 @@ interface Stat { readonly ino: bigint; /** - * @type { number } + * @type { int } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -3958,10 +3957,10 @@ interface Stat { * @atomicservice * @since 20 */ - readonly mode: number; + readonly mode: int; /** - * @type { number } + * @type { int } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -3971,10 +3970,10 @@ interface Stat { * @crossplatform * @since 20 */ - readonly uid: number; + readonly uid: int; /** - * @type { number } + * @type { int } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -3982,10 +3981,10 @@ interface Stat { * @crossplatform * @since 20 */ - readonly gid: number; + readonly gid: int; /** - * @type { number } + * @type { long } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -3994,10 +3993,10 @@ interface Stat { * @atomicservice * @since 20 */ - readonly size: number; + readonly size: long; /** - * @type { number } + * @type { long } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -4006,10 +4005,10 @@ interface Stat { * @atomicservice * @since 20 */ - readonly atime: number; + readonly atime: long; /** - * @type { number } + * @type { long } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -4018,10 +4017,10 @@ interface Stat { * @atomicservice * @since 20 */ - readonly mtime: number; + readonly mtime: long; /** - * @type { number } + * @type { long } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -4029,7 +4028,7 @@ interface Stat { * @crossplatform * @since 20 */ - readonly ctime: number; + readonly ctime: long; /** * Returns nanosecond of the access time. @@ -4277,7 +4276,7 @@ interface Stream { * * @param { ArrayBuffer | string } buffer - buffer. * @param { WriteOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes written to file in promise mode. + * @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 @@ -4296,13 +4295,13 @@ interface Stream { write( buffer: ArrayBuffer | string, options?: WriteOptions - ): Promise; + ): 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. + * @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 @@ -4318,14 +4317,14 @@ interface Stream { * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; + write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; /** * 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. + * @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 @@ -4344,7 +4343,7 @@ interface Stream { write( buffer: ArrayBuffer | string, options: WriteOptions, - callback: AsyncCallback + callback: AsyncCallback ): void; /** @@ -4352,7 +4351,7 @@ interface Stream { * * @param { ArrayBuffer | string } buffer - buffer. * @param { WriteOptions } [options] - options. - * @returns { number } Returns the number of file bytes written to file. + * @returns { long } 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 @@ -4371,14 +4370,14 @@ interface Stream { writeSync( buffer: ArrayBuffer | string, options?: WriteOptions - ): number; + ): long; /** * Read stream. * * @param { ArrayBuffer } buffer - buffer. * @param { ReadOptions } [options] - options. - * @returns { Promise } Returns the number of file bytes read to buffer in promise mode. + * @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 @@ -4395,13 +4394,13 @@ interface Stream { read( buffer: ArrayBuffer, options?: ReadOptions - ): Promise; + ): Promise; /** * Read stream. * * @param { ArrayBuffer } buffer - buffer. - * @param { AsyncCallback } callback - The callback is used to return the number of file bytes read to 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 @@ -4414,14 +4413,14 @@ interface Stream { * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - read(buffer: ArrayBuffer, callback: AsyncCallback): void; + read(buffer: ArrayBuffer, callback: AsyncCallback): void; /** * 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. + * @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 @@ -4437,7 +4436,7 @@ interface Stream { read( buffer: ArrayBuffer, options: ReadOptions, - callback: AsyncCallback + callback: AsyncCallback ): void; /** @@ -4445,7 +4444,7 @@ interface Stream { * * @param { ArrayBuffer } buffer - buffer. * @param { ReadOptions } [options] - options. - * @returns { number } Returns the number of file bytes read to file. + * @returns { long } 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 @@ -4462,7 +4461,7 @@ interface Stream { readSync( buffer: ArrayBuffer, options?: ReadOptions - ): number; + ): long; } /** @@ -4519,7 +4518,7 @@ interface Watcher { /** * Enumeration of different types of whence. * - * @enum { number } whence type + * @enum { int } whence type * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ @@ -4552,7 +4551,7 @@ enum WhenceType { /** * Enumeration of different types of file location. * - * @enum { number } location type + * @enum { int } location type * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ @@ -4577,7 +4576,7 @@ enum LocationType { /** * Enumeration of different types of access mode. * - * @enum { number } access mode type + * @enum { int } access mode type * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice @@ -4628,7 +4627,7 @@ enum AccessModeType { /** * Enumeration of different types of access flag. * - * @enum { number } access flag type + * @enum { int } access flag type * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ @@ -4696,22 +4695,22 @@ export interface WatchEvent { /** * Event happened. * - * @type { number } + * @type { int } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly event: number; + readonly event: int; /** * Associated rename event. * - * @type { number } + * @type { int } * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - readonly cookie: number; + readonly cookie: int; } /** @@ -4788,24 +4787,24 @@ export interface Filter { /** * The exceeding size of the file. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 20 */ - fileSizeOver?: number; + fileSizeOver?: long; /** * The last modification time of the file. * - * @type { ?number } + * @type { ?double } * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 20 */ - lastModifiedAfter?: number; + lastModifiedAfter?: double; /** * Whether to exclude media files. @@ -4880,23 +4879,23 @@ export interface ReadOptions { /** * The offset when reading the file. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 20 */ - offset?: number; + offset?: long; /** * The length for reading. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 20 */ - length?: number; + length?: long; } /** @@ -4936,23 +4935,23 @@ export interface WriteOptions extends Options { /** * The offset when writing the file. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 20 */ - offset?: number; + offset?: long; /** * The length for writing. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @crossplatform * @atomicservice * @since 20 */ - length?: number; + length?: long; } /** @@ -4977,12 +4976,12 @@ export interface ListFileOptions { /** * The number of files listed. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice * @since 20 */ - listNum?: number; + listNum?: int; /** * The filter of listing files. @@ -5006,20 +5005,20 @@ export interface RandomAccessFileOptions { /** * The starting position of file offset. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - start?: number; + start?: long; /** * The ending position of file offset. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - end?: number; + end?: long; } /** @@ -5033,20 +5032,20 @@ export interface ReadStreamOptions { /** * The starting range for reading a file by stream. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - start?: number; + start?: long; /** * The ending range for reading a file by stream. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - end?: number; + end?: long; } /** @@ -5060,19 +5059,19 @@ export interface WriteStreamOptions { /** * The mode for creating write stream. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - mode?: number; + mode?: int; /** * The starting range for writing a file by stream. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ - start?: number; + start?: long; } /** diff --git a/api/@ohos.file.statvfs.d.ts b/api/@ohos.file.statvfs.d.ts index ceadd10534..003520d3e6 100644 --- a/api/@ohos.file.statvfs.d.ts +++ b/api/@ohos.file.statvfs.d.ts @@ -41,7 +41,7 @@ declare namespace statfs { * Get the number of free bytes on the specified path. * * @param { string } path - path - * @returns { Promise } return Promise + * @returns { Promise } return Promise * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -62,7 +62,7 @@ declare namespace statfs { * Get the number of free bytes on the specified path. * * @param { string } path - path - * @returns { Promise } return Promise + * @returns { Promise } return Promise * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -81,13 +81,13 @@ declare namespace statfs { * @since 20 * @arkts 1.1&1.2 */ - function getFreeSize(path: string): Promise; + function getFreeSize(path: string): Promise; /** * Get the number of free bytes on the specified path. * * @param { string } path - path - * @param { AsyncCallback } [callback] - callback + * @param { AsyncCallback } [callback] - callback * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -108,7 +108,7 @@ declare namespace statfs { * Get the number of free bytes on the specified path. * * @param { string } path - path - * @param { AsyncCallback } [callback] - callback + * @param { AsyncCallback } [callback] - callback * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -127,13 +127,13 @@ declare namespace statfs { * @since 20 * @arkts 1.1&1.2 */ - function getFreeSize(path: string, callback: AsyncCallback): void; + function getFreeSize(path: string, callback: AsyncCallback): void; /** * Get the number of free bytes on the specified path with sync interface. * * @param { string } path - path - * @returns { number } return the number of free bytes on the specified path + * @returns { long } return the number of free bytes on the specified path * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -154,7 +154,7 @@ declare namespace statfs { * Get the number of free bytes on the specified path with sync interface. * * @param { string } path - path - * @returns { number } return the number of free bytes on the specified path + * @returns { long } return the number of free bytes on the specified path * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -173,13 +173,13 @@ declare namespace statfs { * @since 20 * @arkts 1.1&1.2 */ - function getFreeSizeSync(path: string): number; + function getFreeSizeSync(path: string): long; /** * Get the number of total bytes on the specified path. * * @param { string } path - path - * @returns { Promise } return Promise + * @returns { Promise } return Promise * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -200,7 +200,7 @@ declare namespace statfs { * Get the number of total bytes on the specified path. * * @param { string } path - path - * @returns { Promise } return Promise + * @returns { Promise } return Promise * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -219,13 +219,13 @@ declare namespace statfs { * @since 20 * @arkts 1.1&1.2 */ - function getTotalSize(path: string): Promise; + function getTotalSize(path: string): Promise; /** * Get the number of total bytes on the specified path. * * @param { string } path - path - * @param { AsyncCallback } [callback] - callback + * @param { AsyncCallback } [callback] - callback * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -246,7 +246,7 @@ declare namespace statfs { * Get the number of total bytes on the specified path. * * @param { string } path - path - * @param { AsyncCallback } [callback] - callback + * @param { AsyncCallback } [callback] - callback * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -265,13 +265,13 @@ declare namespace statfs { * @since 20 * @arkts 1.1&1.2 */ - function getTotalSize(path: string, callback: AsyncCallback): void; + function getTotalSize(path: string, callback: AsyncCallback): void; /** * Get the number of total bytes on the specified path with sync interface. * * @param { string } path - path - * @returns { number } return the number of total bytes + * @returns { long } return the number of total bytes * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -292,7 +292,7 @@ declare namespace statfs { * Get the number of total bytes on the specified path with sync interface. * * @param { string } path - path - * @returns { number } return the number of total bytes + * @returns { long } return the number of total bytes * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -311,7 +311,7 @@ declare namespace statfs { * @since 20 * @arkts 1.1&1.2 */ - function getTotalSizeSync(path: string): number; + function getTotalSizeSync(path: string): long; } export default statfs; -- Gitee From 16f5b9629aedfcde5f81cc5ed03002544ac5d70c Mon Sep 17 00:00:00 2001 From: zxl <1554188414@qq.com> Date: Tue, 22 Jul 2025 19:18:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zxl <1554188414@qq.com> Change-Id: Icba3df881c9047b4d40385fbfd7cf9a6dbe64eab --- api/@ohos.file.fs.d.ets | 17 +++++++++-------- api/@ohos.file.statvfs.d.ts | 12 ++++++------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/api/@ohos.file.fs.d.ets b/api/@ohos.file.fs.d.ets index b88ed76a08..735f45cac8 100644 --- a/api/@ohos.file.fs.d.ets +++ b/api/@ohos.file.fs.d.ets @@ -2804,6 +2804,7 @@ function truncate(file: string | int, callback: AsyncCallback): void; /** * Truncate file. * + * @param { string | int } file - path or file descriptor. * @param { long } [len = 0] - len. * @param { AsyncCallback } callback - Return the callback function. * @throws { BusinessError } 13900001 - Operation not permitted @@ -3948,7 +3949,7 @@ interface Stat { readonly ino: bigint; /** - * @type { int } + * @type { long } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -3957,10 +3958,10 @@ interface Stat { * @atomicservice * @since 20 */ - readonly mode: int; + readonly mode: long; /** - * @type { int } + * @type { long } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -3970,10 +3971,10 @@ interface Stat { * @crossplatform * @since 20 */ - readonly uid: int; + readonly uid: long; /** - * @type { int } + * @type { long } * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error @@ -3981,7 +3982,7 @@ interface Stat { * @crossplatform * @since 20 */ - readonly gid: int; + readonly gid: long; /** * @type { long } @@ -4976,12 +4977,12 @@ export interface ListFileOptions { /** * The number of files listed. * - * @type { ?int } + * @type { ?long } * @syscap SystemCapability.FileManagement.File.FileIO * @atomicservice * @since 20 */ - listNum?: int; + listNum?: long; /** * The filter of listing files. diff --git a/api/@ohos.file.statvfs.d.ts b/api/@ohos.file.statvfs.d.ts index 003520d3e6..b844c7dd5f 100644 --- a/api/@ohos.file.statvfs.d.ts +++ b/api/@ohos.file.statvfs.d.ts @@ -41,7 +41,7 @@ declare namespace statfs { * Get the number of free bytes on the specified path. * * @param { string } path - path - * @returns { Promise } return Promise + * @returns { Promise } return Promise * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -87,7 +87,7 @@ declare namespace statfs { * Get the number of free bytes on the specified path. * * @param { string } path - path - * @param { AsyncCallback } [callback] - callback + * @param { AsyncCallback } [callback] - callback * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -133,7 +133,7 @@ declare namespace statfs { * Get the number of free bytes on the specified path with sync interface. * * @param { string } path - path - * @returns { long } return the number of free bytes on the specified path + * @returns { number } return the number of free bytes on the specified path * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -179,7 +179,7 @@ declare namespace statfs { * Get the number of total bytes on the specified path. * * @param { string } path - path - * @returns { Promise } return Promise + * @returns { Promise } return Promise * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -225,7 +225,7 @@ declare namespace statfs { * Get the number of total bytes on the specified path. * * @param { string } path - path - * @param { AsyncCallback } [callback] - callback + * @param { AsyncCallback } [callback] - callback * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error @@ -271,7 +271,7 @@ declare namespace statfs { * Get the number of total bytes on the specified path with sync interface. * * @param { string } path - path - * @returns { long } return the number of total bytes + * @returns { number } return the number of total bytes * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900004 - Interrupted system call * @throws { BusinessError } 13900005 - I/O error -- Gitee