161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit CoreFileKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport stream from './@ohos.util.stream'; 2361847f8eSopenharmony_ci 2461847f8eSopenharmony_ciexport default fileIo; 2561847f8eSopenharmony_ci 2661847f8eSopenharmony_ci/** 2761847f8eSopenharmony_ci * FileIO 2861847f8eSopenharmony_ci * 2961847f8eSopenharmony_ci * @namespace fileIo 3061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 3161847f8eSopenharmony_ci * @since 9 3261847f8eSopenharmony_ci */ 3361847f8eSopenharmony_ci/** 3461847f8eSopenharmony_ci * FileIO 3561847f8eSopenharmony_ci * 3661847f8eSopenharmony_ci * @namespace fileIo 3761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 3861847f8eSopenharmony_ci * @crossplatform 3961847f8eSopenharmony_ci * @since 10 4061847f8eSopenharmony_ci */ 4161847f8eSopenharmony_ci/** 4261847f8eSopenharmony_ci * FileIO 4361847f8eSopenharmony_ci * 4461847f8eSopenharmony_ci * @namespace fileIo 4561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 4661847f8eSopenharmony_ci * @crossplatform 4761847f8eSopenharmony_ci * @atomicservice 4861847f8eSopenharmony_ci * @since 11 4961847f8eSopenharmony_ci */ 5061847f8eSopenharmony_ci/** 5161847f8eSopenharmony_ci * FileIO 5261847f8eSopenharmony_ci * 5361847f8eSopenharmony_ci * @namespace fileIo 5461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 5561847f8eSopenharmony_ci * @crossplatform 5661847f8eSopenharmony_ci * @atomicservice 5761847f8eSopenharmony_ci * @since 12 5861847f8eSopenharmony_ci */ 5961847f8eSopenharmony_cideclare namespace fileIo { 6061847f8eSopenharmony_ci export { access }; 6161847f8eSopenharmony_ci export { accessSync }; 6261847f8eSopenharmony_ci export { close }; 6361847f8eSopenharmony_ci export { closeSync }; 6461847f8eSopenharmony_ci export { copy }; 6561847f8eSopenharmony_ci export { copyDir }; 6661847f8eSopenharmony_ci export { copyDirSync }; 6761847f8eSopenharmony_ci export { copyFile }; 6861847f8eSopenharmony_ci export { copyFileSync }; 6961847f8eSopenharmony_ci export { createRandomAccessFile }; 7061847f8eSopenharmony_ci export { createRandomAccessFileSync }; 7161847f8eSopenharmony_ci export { createStream }; 7261847f8eSopenharmony_ci export { createStreamSync }; 7361847f8eSopenharmony_ci export { createReadStream }; 7461847f8eSopenharmony_ci export { createWriteStream }; 7561847f8eSopenharmony_ci export { createWatcher }; 7661847f8eSopenharmony_ci export { dup }; 7761847f8eSopenharmony_ci export { fdatasync }; 7861847f8eSopenharmony_ci export { fdatasyncSync }; 7961847f8eSopenharmony_ci export { fdopenStream }; 8061847f8eSopenharmony_ci export { fdopenStreamSync }; 8161847f8eSopenharmony_ci export { fsync }; 8261847f8eSopenharmony_ci export { fsyncSync }; 8361847f8eSopenharmony_ci export { getxattr }; 8461847f8eSopenharmony_ci export { getxattrSync }; 8561847f8eSopenharmony_ci export { listFile }; 8661847f8eSopenharmony_ci export { listFileSync }; 8761847f8eSopenharmony_ci export { lseek }; 8861847f8eSopenharmony_ci export { lstat }; 8961847f8eSopenharmony_ci export { lstatSync }; 9061847f8eSopenharmony_ci export { mkdir }; 9161847f8eSopenharmony_ci export { mkdirSync }; 9261847f8eSopenharmony_ci export { mkdtemp }; 9361847f8eSopenharmony_ci export { mkdtempSync }; 9461847f8eSopenharmony_ci export { moveDir }; 9561847f8eSopenharmony_ci export { moveDirSync }; 9661847f8eSopenharmony_ci export { moveFile }; 9761847f8eSopenharmony_ci export { moveFileSync }; 9861847f8eSopenharmony_ci export { open }; 9961847f8eSopenharmony_ci export { openSync }; 10061847f8eSopenharmony_ci export { read }; 10161847f8eSopenharmony_ci export { readSync }; 10261847f8eSopenharmony_ci export { readLines }; 10361847f8eSopenharmony_ci export { readLinesSync }; 10461847f8eSopenharmony_ci export { readText }; 10561847f8eSopenharmony_ci export { readTextSync }; 10661847f8eSopenharmony_ci export { rename }; 10761847f8eSopenharmony_ci export { renameSync }; 10861847f8eSopenharmony_ci export { rmdir }; 10961847f8eSopenharmony_ci export { rmdirSync }; 11061847f8eSopenharmony_ci export { setxattr }; 11161847f8eSopenharmony_ci export { setxattrSync }; 11261847f8eSopenharmony_ci export { stat }; 11361847f8eSopenharmony_ci export { statSync }; 11461847f8eSopenharmony_ci export { symlink }; 11561847f8eSopenharmony_ci export { symlinkSync }; 11661847f8eSopenharmony_ci export { truncate }; 11761847f8eSopenharmony_ci export { truncateSync }; 11861847f8eSopenharmony_ci export { unlink }; 11961847f8eSopenharmony_ci export { unlinkSync }; 12061847f8eSopenharmony_ci export { utimes }; 12161847f8eSopenharmony_ci export { write }; 12261847f8eSopenharmony_ci export { writeSync }; 12361847f8eSopenharmony_ci export { AccessModeType }; 12461847f8eSopenharmony_ci export { AccessFlagType }; 12561847f8eSopenharmony_ci export { File }; 12661847f8eSopenharmony_ci export { OpenMode }; 12761847f8eSopenharmony_ci export { RandomAccessFile }; 12861847f8eSopenharmony_ci export { ReaderIterator }; 12961847f8eSopenharmony_ci export { Stat }; 13061847f8eSopenharmony_ci export { Stream }; 13161847f8eSopenharmony_ci export { ReadStream }; 13261847f8eSopenharmony_ci export { WriteStream }; 13361847f8eSopenharmony_ci export { Watcher }; 13461847f8eSopenharmony_ci export { WhenceType }; 13561847f8eSopenharmony_ci export { TaskSignal }; 13661847f8eSopenharmony_ci export { connectDfs }; 13761847f8eSopenharmony_ci export { disconnectDfs }; 13861847f8eSopenharmony_ci export type { Progress }; 13961847f8eSopenharmony_ci export type { CopyOptions }; 14061847f8eSopenharmony_ci export type { ProgressListener }; 14161847f8eSopenharmony_ci export type { DfsListeners }; 14261847f8eSopenharmony_ci 14361847f8eSopenharmony_ci /** 14461847f8eSopenharmony_ci * Mode Indicates the open flags. 14561847f8eSopenharmony_ci * 14661847f8eSopenharmony_ci * @namespace OpenMode 14761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 14861847f8eSopenharmony_ci * @since 9 14961847f8eSopenharmony_ci */ 15061847f8eSopenharmony_ci /** 15161847f8eSopenharmony_ci * Mode Indicates the open flags. 15261847f8eSopenharmony_ci * 15361847f8eSopenharmony_ci * @namespace OpenMode 15461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 15561847f8eSopenharmony_ci * @crossplatform 15661847f8eSopenharmony_ci * @since 10 15761847f8eSopenharmony_ci */ 15861847f8eSopenharmony_ci /** 15961847f8eSopenharmony_ci * Mode Indicates the open flags. 16061847f8eSopenharmony_ci * 16161847f8eSopenharmony_ci * @namespace OpenMode 16261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 16361847f8eSopenharmony_ci * @crossplatform 16461847f8eSopenharmony_ci * @atomicservice 16561847f8eSopenharmony_ci * @since 11 16661847f8eSopenharmony_ci */ 16761847f8eSopenharmony_ci namespace OpenMode { 16861847f8eSopenharmony_ci /** 16961847f8eSopenharmony_ci * Read only Permission. 17061847f8eSopenharmony_ci * 17161847f8eSopenharmony_ci * @constant 17261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 17361847f8eSopenharmony_ci * @since 9 17461847f8eSopenharmony_ci */ 17561847f8eSopenharmony_ci /** 17661847f8eSopenharmony_ci * Read only Permission. 17761847f8eSopenharmony_ci * 17861847f8eSopenharmony_ci * @constant 17961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 18061847f8eSopenharmony_ci * @crossplatform 18161847f8eSopenharmony_ci * @since 10 18261847f8eSopenharmony_ci */ 18361847f8eSopenharmony_ci /** 18461847f8eSopenharmony_ci * Read only Permission. 18561847f8eSopenharmony_ci * 18661847f8eSopenharmony_ci * @constant 18761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 18861847f8eSopenharmony_ci * @crossplatform 18961847f8eSopenharmony_ci * @atomicservice 19061847f8eSopenharmony_ci * @since 11 19161847f8eSopenharmony_ci */ 19261847f8eSopenharmony_ci const READ_ONLY = 0o0; 19361847f8eSopenharmony_ci /** 19461847f8eSopenharmony_ci * Write only Permission. 19561847f8eSopenharmony_ci * 19661847f8eSopenharmony_ci * @constant 19761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 19861847f8eSopenharmony_ci * @since 9 19961847f8eSopenharmony_ci */ 20061847f8eSopenharmony_ci /** 20161847f8eSopenharmony_ci * Write only Permission. 20261847f8eSopenharmony_ci * 20361847f8eSopenharmony_ci * @constant 20461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 20561847f8eSopenharmony_ci * @crossplatform 20661847f8eSopenharmony_ci * @since 10 20761847f8eSopenharmony_ci */ 20861847f8eSopenharmony_ci /** 20961847f8eSopenharmony_ci * Write only Permission. 21061847f8eSopenharmony_ci * 21161847f8eSopenharmony_ci * @constant 21261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 21361847f8eSopenharmony_ci * @crossplatform 21461847f8eSopenharmony_ci * @atomicservice 21561847f8eSopenharmony_ci * @since 11 21661847f8eSopenharmony_ci */ 21761847f8eSopenharmony_ci const WRITE_ONLY = 0o1; 21861847f8eSopenharmony_ci /** 21961847f8eSopenharmony_ci * Write and Read Permission. 22061847f8eSopenharmony_ci * 22161847f8eSopenharmony_ci * @constant 22261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 22361847f8eSopenharmony_ci * @since 9 22461847f8eSopenharmony_ci */ 22561847f8eSopenharmony_ci /** 22661847f8eSopenharmony_ci * Write and Read Permission. 22761847f8eSopenharmony_ci * 22861847f8eSopenharmony_ci * @constant 22961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 23061847f8eSopenharmony_ci * @crossplatform 23161847f8eSopenharmony_ci * @since 10 23261847f8eSopenharmony_ci */ 23361847f8eSopenharmony_ci /** 23461847f8eSopenharmony_ci * Write and Read Permission. 23561847f8eSopenharmony_ci * 23661847f8eSopenharmony_ci * @constant 23761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 23861847f8eSopenharmony_ci * @crossplatform 23961847f8eSopenharmony_ci * @atomicservice 24061847f8eSopenharmony_ci * @since 11 24161847f8eSopenharmony_ci */ 24261847f8eSopenharmony_ci const READ_WRITE = 0o2; 24361847f8eSopenharmony_ci /** 24461847f8eSopenharmony_ci * If not exist, create file. 24561847f8eSopenharmony_ci * 24661847f8eSopenharmony_ci * @constant 24761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 24861847f8eSopenharmony_ci * @since 9 24961847f8eSopenharmony_ci */ 25061847f8eSopenharmony_ci /** 25161847f8eSopenharmony_ci * If not exist, create file. 25261847f8eSopenharmony_ci * 25361847f8eSopenharmony_ci * @constant 25461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 25561847f8eSopenharmony_ci * @crossplatform 25661847f8eSopenharmony_ci * @since 10 25761847f8eSopenharmony_ci */ 25861847f8eSopenharmony_ci /** 25961847f8eSopenharmony_ci * If not exist, create file. 26061847f8eSopenharmony_ci * 26161847f8eSopenharmony_ci * @constant 26261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 26361847f8eSopenharmony_ci * @crossplatform 26461847f8eSopenharmony_ci * @atomicservice 26561847f8eSopenharmony_ci * @since 11 26661847f8eSopenharmony_ci */ 26761847f8eSopenharmony_ci const CREATE = 0o100; 26861847f8eSopenharmony_ci /** 26961847f8eSopenharmony_ci * File truncate len 0. 27061847f8eSopenharmony_ci * 27161847f8eSopenharmony_ci * @constant 27261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 27361847f8eSopenharmony_ci * @since 9 27461847f8eSopenharmony_ci */ 27561847f8eSopenharmony_ci /** 27661847f8eSopenharmony_ci * File truncate len 0. 27761847f8eSopenharmony_ci * 27861847f8eSopenharmony_ci * @constant 27961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 28061847f8eSopenharmony_ci * @crossplatform 28161847f8eSopenharmony_ci * @since 10 28261847f8eSopenharmony_ci */ 28361847f8eSopenharmony_ci /** 28461847f8eSopenharmony_ci * File truncate len 0. 28561847f8eSopenharmony_ci * 28661847f8eSopenharmony_ci * @constant 28761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 28861847f8eSopenharmony_ci * @crossplatform 28961847f8eSopenharmony_ci * @atomicservice 29061847f8eSopenharmony_ci * @since 11 29161847f8eSopenharmony_ci */ 29261847f8eSopenharmony_ci const TRUNC = 0o1000; 29361847f8eSopenharmony_ci /** 29461847f8eSopenharmony_ci * File append write. 29561847f8eSopenharmony_ci * 29661847f8eSopenharmony_ci * @constant 29761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 29861847f8eSopenharmony_ci * @since 9 29961847f8eSopenharmony_ci */ 30061847f8eSopenharmony_ci /** 30161847f8eSopenharmony_ci * File append write. 30261847f8eSopenharmony_ci * 30361847f8eSopenharmony_ci * @constant 30461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 30561847f8eSopenharmony_ci * @crossplatform 30661847f8eSopenharmony_ci * @since 10 30761847f8eSopenharmony_ci */ 30861847f8eSopenharmony_ci /** 30961847f8eSopenharmony_ci * File append write. 31061847f8eSopenharmony_ci * 31161847f8eSopenharmony_ci * @constant 31261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 31361847f8eSopenharmony_ci * @crossplatform 31461847f8eSopenharmony_ci * @atomicservice 31561847f8eSopenharmony_ci * @since 11 31661847f8eSopenharmony_ci */ 31761847f8eSopenharmony_ci const APPEND = 0o2000; 31861847f8eSopenharmony_ci /** 31961847f8eSopenharmony_ci * File open in nonblocking mode. 32061847f8eSopenharmony_ci * 32161847f8eSopenharmony_ci * @constant 32261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 32361847f8eSopenharmony_ci * @since 9 32461847f8eSopenharmony_ci */ 32561847f8eSopenharmony_ci /** 32661847f8eSopenharmony_ci * File open in nonblocking mode. 32761847f8eSopenharmony_ci * 32861847f8eSopenharmony_ci * @constant 32961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 33061847f8eSopenharmony_ci * @crossplatform 33161847f8eSopenharmony_ci * @since 10 33261847f8eSopenharmony_ci */ 33361847f8eSopenharmony_ci const NONBLOCK = 0o4000; 33461847f8eSopenharmony_ci /** 33561847f8eSopenharmony_ci * File is Dir. 33661847f8eSopenharmony_ci * 33761847f8eSopenharmony_ci * @constant 33861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 33961847f8eSopenharmony_ci * @since 9 34061847f8eSopenharmony_ci */ 34161847f8eSopenharmony_ci /** 34261847f8eSopenharmony_ci * File is Dir. 34361847f8eSopenharmony_ci * 34461847f8eSopenharmony_ci * @constant 34561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 34661847f8eSopenharmony_ci * @crossplatform 34761847f8eSopenharmony_ci * @since 10 34861847f8eSopenharmony_ci */ 34961847f8eSopenharmony_ci const DIR = 0o200000; 35061847f8eSopenharmony_ci /** 35161847f8eSopenharmony_ci * File is not symbolic link. 35261847f8eSopenharmony_ci * 35361847f8eSopenharmony_ci * @constant 35461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 35561847f8eSopenharmony_ci * @since 9 35661847f8eSopenharmony_ci */ 35761847f8eSopenharmony_ci /** 35861847f8eSopenharmony_ci * File is not symbolic link. 35961847f8eSopenharmony_ci * 36061847f8eSopenharmony_ci * @constant 36161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 36261847f8eSopenharmony_ci * @crossplatform 36361847f8eSopenharmony_ci * @since 10 36461847f8eSopenharmony_ci */ 36561847f8eSopenharmony_ci const NOFOLLOW = 0o400000; 36661847f8eSopenharmony_ci /** 36761847f8eSopenharmony_ci * SYNC IO. 36861847f8eSopenharmony_ci * 36961847f8eSopenharmony_ci * @constant 37061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 37161847f8eSopenharmony_ci * @since 9 37261847f8eSopenharmony_ci */ 37361847f8eSopenharmony_ci /** 37461847f8eSopenharmony_ci * SYNC IO. 37561847f8eSopenharmony_ci * 37661847f8eSopenharmony_ci * @constant 37761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 37861847f8eSopenharmony_ci * @crossplatform 37961847f8eSopenharmony_ci * @since 10 38061847f8eSopenharmony_ci */ 38161847f8eSopenharmony_ci const SYNC = 0o4010000; 38261847f8eSopenharmony_ci } 38361847f8eSopenharmony_ci} 38461847f8eSopenharmony_ci 38561847f8eSopenharmony_ci/** 38661847f8eSopenharmony_ci * Access file. 38761847f8eSopenharmony_ci * 38861847f8eSopenharmony_ci * @param { string } path - path. 38961847f8eSopenharmony_ci * @returns { Promise<boolean> } return Promise 39061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 39161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 39261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 39361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 39461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 39561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 39661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 39761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 39861847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 39961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 40061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 40161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 40261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 40361847f8eSopenharmony_ci * @since 9 40461847f8eSopenharmony_ci */ 40561847f8eSopenharmony_ci/** 40661847f8eSopenharmony_ci * Access file. 40761847f8eSopenharmony_ci * 40861847f8eSopenharmony_ci * @param { string } path - path. 40961847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the file is accessible or not in promise mode. 41061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 41161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 41261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 41361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 41461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 41561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 41661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 41761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 41861847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 41961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 42061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 42161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 42261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 42361847f8eSopenharmony_ci * @crossplatform 42461847f8eSopenharmony_ci * @since 10 42561847f8eSopenharmony_ci */ 42661847f8eSopenharmony_ci/** 42761847f8eSopenharmony_ci * Access file. 42861847f8eSopenharmony_ci * 42961847f8eSopenharmony_ci * @param { string } path - path. 43061847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the file is accessible or not in promise mode. 43161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 43261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 43361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 43461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 43561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 43661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 43761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 43861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 43961847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 44061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 44161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 44261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 44361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 44461847f8eSopenharmony_ci * @crossplatform 44561847f8eSopenharmony_ci * @atomicservice 44661847f8eSopenharmony_ci * @since 11 44761847f8eSopenharmony_ci */ 44861847f8eSopenharmony_ci/** 44961847f8eSopenharmony_ci * Access file. 45061847f8eSopenharmony_ci * 45161847f8eSopenharmony_ci * @param { string } path - path. 45261847f8eSopenharmony_ci * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - accessibility mode. 45361847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the file is accessible or not in promise mode. 45461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 45561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 45661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 45761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 45861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 45961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 46061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 46161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 46261847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 46361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 46461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 46561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 46661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 46761847f8eSopenharmony_ci * @crossplatform 46861847f8eSopenharmony_ci * @atomicservice 46961847f8eSopenharmony_ci * @since 12 47061847f8eSopenharmony_ci */ 47161847f8eSopenharmony_cideclare function access(path: string, mode?: AccessModeType): Promise<boolean>; 47261847f8eSopenharmony_ci 47361847f8eSopenharmony_ci/** 47461847f8eSopenharmony_ci * Access file. 47561847f8eSopenharmony_ci * 47661847f8eSopenharmony_ci * @param { string } path - path. 47761847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback is used to return the file is accessible or not. 47861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 47961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 48061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 48161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 48261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 48361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 48461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 48561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 48661847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 48761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 48861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 48961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 49061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 49161847f8eSopenharmony_ci * @since 9 49261847f8eSopenharmony_ci */ 49361847f8eSopenharmony_ci/** 49461847f8eSopenharmony_ci * Access file. 49561847f8eSopenharmony_ci * 49661847f8eSopenharmony_ci * @param { string } path - path. 49761847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback is used to return the file is accessible or not. 49861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 49961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 50061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 50161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 50261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 50361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 50461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 50561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 50661847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 50761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 50861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 50961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 51061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 51161847f8eSopenharmony_ci * @crossplatform 51261847f8eSopenharmony_ci * @since 10 51361847f8eSopenharmony_ci */ 51461847f8eSopenharmony_ci/** 51561847f8eSopenharmony_ci * Access file. 51661847f8eSopenharmony_ci * 51761847f8eSopenharmony_ci * @param { string } path - path. 51861847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback is used to return the file is accessible or not. 51961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 52061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 52161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 52261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 52361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 52461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 52561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 52661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 52761847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 52861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 52961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 53061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 53161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 53261847f8eSopenharmony_ci * @crossplatform 53361847f8eSopenharmony_ci * @atomicservice 53461847f8eSopenharmony_ci * @since 11 53561847f8eSopenharmony_ci */ 53661847f8eSopenharmony_cideclare function access(path: string, callback: AsyncCallback<boolean>): void; 53761847f8eSopenharmony_ci 53861847f8eSopenharmony_ci/** 53961847f8eSopenharmony_ci * Access file. 54061847f8eSopenharmony_ci * 54161847f8eSopenharmony_ci * @param { string } path - file path that needs to be checked whether the calling process can access. 54261847f8eSopenharmony_ci * @param { AccessModeType } mode - accessibility mode. 54361847f8eSopenharmony_ci * @param { AccessFlagType } flag - accessibility flag. 54461847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the file is accessible or not in promise mode. 54561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 54661847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 54761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 54861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 54961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 55061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 55161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 55261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 55361847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 55461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 55561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 55661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 55761847f8eSopenharmony_ci * @since 12 55861847f8eSopenharmony_ci */ 55961847f8eSopenharmony_cideclare function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise<boolean>; 56061847f8eSopenharmony_ci 56161847f8eSopenharmony_ci/** 56261847f8eSopenharmony_ci * Access file with sync interface. 56361847f8eSopenharmony_ci * 56461847f8eSopenharmony_ci * @param { string } path - path. 56561847f8eSopenharmony_ci * @returns { boolean } Returns the file is accessible or not. 56661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 56761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 56861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 56961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 57061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 57161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 57261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 57361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 57461847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 57561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 57661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 57761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 57861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 57961847f8eSopenharmony_ci * @since 9 58061847f8eSopenharmony_ci */ 58161847f8eSopenharmony_ci/** 58261847f8eSopenharmony_ci * Access file with sync interface. 58361847f8eSopenharmony_ci * 58461847f8eSopenharmony_ci * @param { string } path - path. 58561847f8eSopenharmony_ci * @returns { boolean } Returns the file is accessible or not. 58661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 58761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 58861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 58961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 59061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 59161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 59261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 59361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 59461847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 59561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 59661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 59761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 59861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 59961847f8eSopenharmony_ci * @crossplatform 60061847f8eSopenharmony_ci * @since 10 60161847f8eSopenharmony_ci */ 60261847f8eSopenharmony_ci/** 60361847f8eSopenharmony_ci * Access file with sync interface. 60461847f8eSopenharmony_ci * 60561847f8eSopenharmony_ci * @param { string } path - path. 60661847f8eSopenharmony_ci * @returns { boolean } Returns the file is accessible or not. 60761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 60861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 60961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 61061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 61161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 61261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 61361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 61461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 61561847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 61661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 61761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 61861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 61961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 62061847f8eSopenharmony_ci * @crossplatform 62161847f8eSopenharmony_ci * @atomicservice 62261847f8eSopenharmony_ci * @since 11 62361847f8eSopenharmony_ci */ 62461847f8eSopenharmony_ci/** 62561847f8eSopenharmony_ci * 62661847f8eSopenharmony_ci * Access file with sync interface. 62761847f8eSopenharmony_ci * 62861847f8eSopenharmony_ci * @param { string } path - path. 62961847f8eSopenharmony_ci * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - accessibility mode. 63061847f8eSopenharmony_ci * @returns { boolean } Returns the file is accessible or not. 63161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 63261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 63361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 63461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 63561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 63661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 63761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 63861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 63961847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 64061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 64161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 64261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 64361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 64461847f8eSopenharmony_ci * @crossplatform 64561847f8eSopenharmony_ci * @atomicservice 64661847f8eSopenharmony_ci * @since 12 64761847f8eSopenharmony_ci */ 64861847f8eSopenharmony_cideclare function accessSync(path: string, mode?: AccessModeType): boolean; 64961847f8eSopenharmony_ci 65061847f8eSopenharmony_ci/** 65161847f8eSopenharmony_ci * Access file with sync interface. 65261847f8eSopenharmony_ci * 65361847f8eSopenharmony_ci * @param { string } path - file path that needs to be checked whether the calling process can access. 65461847f8eSopenharmony_ci * @param { AccessModeType } mode - accessibility mode. 65561847f8eSopenharmony_ci * @param { AccessFlagType } flag - accessibility flag. 65661847f8eSopenharmony_ci * @returns { boolean } Returns the file is accessible or not. 65761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 65861847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 65961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 66061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 66161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 66261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 66361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 66461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 66561847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 66661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 66761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 66861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 66961847f8eSopenharmony_ci * @since 12 67061847f8eSopenharmony_ci */ 67161847f8eSopenharmony_cideclare function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean; 67261847f8eSopenharmony_ci 67361847f8eSopenharmony_ci/** 67461847f8eSopenharmony_ci * Close file or fd. 67561847f8eSopenharmony_ci * 67661847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 67761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 67861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 67961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 68061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 68161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 68261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 68361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 68461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 68561847f8eSopenharmony_ci * @since 9 68661847f8eSopenharmony_ci */ 68761847f8eSopenharmony_ci/** 68861847f8eSopenharmony_ci * Close file or fd. 68961847f8eSopenharmony_ci * 69061847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 69161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 69261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 69361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 69461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 69561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 69661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 69761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 69861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 69961847f8eSopenharmony_ci * @crossplatform 70061847f8eSopenharmony_ci * @since 10 70161847f8eSopenharmony_ci */ 70261847f8eSopenharmony_ci/** 70361847f8eSopenharmony_ci * Close file or fd. 70461847f8eSopenharmony_ci * 70561847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 70661847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 70761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 70861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 70961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 71061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 71161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 71261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 71361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 71461847f8eSopenharmony_ci * @crossplatform 71561847f8eSopenharmony_ci * @atomicservice 71661847f8eSopenharmony_ci * @since 11 71761847f8eSopenharmony_ci */ 71861847f8eSopenharmony_cideclare function close(file: number | File): Promise<void>; 71961847f8eSopenharmony_ci 72061847f8eSopenharmony_ci/** 72161847f8eSopenharmony_ci * Close file or fd. 72261847f8eSopenharmony_ci * 72361847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 72461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 72561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 72661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 72761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 72861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 72961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 73061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 73161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 73261847f8eSopenharmony_ci * @since 9 73361847f8eSopenharmony_ci */ 73461847f8eSopenharmony_ci/** 73561847f8eSopenharmony_ci * Close file or fd. 73661847f8eSopenharmony_ci * 73761847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 73861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 73961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 74061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 74161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 74261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 74361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 74461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 74561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 74661847f8eSopenharmony_ci * @crossplatform 74761847f8eSopenharmony_ci * @since 10 74861847f8eSopenharmony_ci */ 74961847f8eSopenharmony_ci/** 75061847f8eSopenharmony_ci * Close file or fd. 75161847f8eSopenharmony_ci * 75261847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 75361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 75461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 75561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 75661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 75761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 75861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 75961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 76061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 76161847f8eSopenharmony_ci * @crossplatform 76261847f8eSopenharmony_ci * @atomicservice 76361847f8eSopenharmony_ci * @since 11 76461847f8eSopenharmony_ci */ 76561847f8eSopenharmony_cideclare function close(file: number | File, callback: AsyncCallback<void>): void; 76661847f8eSopenharmony_ci 76761847f8eSopenharmony_ci/** 76861847f8eSopenharmony_ci * Close file or fd with sync interface. 76961847f8eSopenharmony_ci * 77061847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 77161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 77261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 77361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 77461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 77561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 77661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 77761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 77861847f8eSopenharmony_ci * @since 9 77961847f8eSopenharmony_ci */ 78061847f8eSopenharmony_ci/** 78161847f8eSopenharmony_ci * Close file or fd with sync interface. 78261847f8eSopenharmony_ci * 78361847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 78461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 78561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 78661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 78761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 78861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 78961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 79061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 79161847f8eSopenharmony_ci * @crossplatform 79261847f8eSopenharmony_ci * @since 10 79361847f8eSopenharmony_ci */ 79461847f8eSopenharmony_ci/** 79561847f8eSopenharmony_ci * Close file or fd with sync interface. 79661847f8eSopenharmony_ci * 79761847f8eSopenharmony_ci * @param { number | File } file - file object or fd. 79861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 79961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 80061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 80161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 80261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 80361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 80461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 80561847f8eSopenharmony_ci * @crossplatform 80661847f8eSopenharmony_ci * @atomicservice 80761847f8eSopenharmony_ci * @since 11 80861847f8eSopenharmony_ci */ 80961847f8eSopenharmony_cideclare function closeSync(file: number | File): void; 81061847f8eSopenharmony_ci 81161847f8eSopenharmony_ci/** 81261847f8eSopenharmony_ci * Copy file or directory. 81361847f8eSopenharmony_ci * 81461847f8eSopenharmony_ci * @param { string } srcUri - src uri. 81561847f8eSopenharmony_ci * @param { string } destUri - dest uri. 81661847f8eSopenharmony_ci * @param { CopyOptions } [options] - options. 81761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 81861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 81961847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 82061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 82161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 82261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 82361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 82461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 82561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 82661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 82761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied by the file system 82861847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 82961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 83061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 83161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 83261847f8eSopenharmony_ci * @throws { BusinessError } 13900021 - File table overflow 83361847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 83461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 83561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 83661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 83761847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 83861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 83961847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 84061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 84161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 84261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 84361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 84461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 84561847f8eSopenharmony_ci * @since 11 84661847f8eSopenharmony_ci */ 84761847f8eSopenharmony_ci/** 84861847f8eSopenharmony_ci * Copy file or directory. 84961847f8eSopenharmony_ci * 85061847f8eSopenharmony_ci * @param { string } srcUri - src uri. 85161847f8eSopenharmony_ci * @param { string } destUri - dest uri. 85261847f8eSopenharmony_ci * @param { CopyOptions } [options] - options. 85361847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 85461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 85561847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 85661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 85761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 85861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 85961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 86061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 86161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 86261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 86361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied by the file system 86461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 86561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 86661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 86761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 86861847f8eSopenharmony_ci * @throws { BusinessError } 13900021 - File table overflow 86961847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 87061847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 87161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 87261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 87361847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 87461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 87561847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 87661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 87761847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 87861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 87961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 88061847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 88161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 88261847f8eSopenharmony_ci * @since 12 88361847f8eSopenharmony_ci */ 88461847f8eSopenharmony_cideclare function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise<void>; 88561847f8eSopenharmony_ci 88661847f8eSopenharmony_ci/** 88761847f8eSopenharmony_ci * Copy file or directory. 88861847f8eSopenharmony_ci * 88961847f8eSopenharmony_ci * @param { string } srcUri - src uri. 89061847f8eSopenharmony_ci * @param { string } destUri - dest uri. 89161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 89261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 89361847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 89461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 89561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 89661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 89761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 89861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 89961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 90061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 90161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied by the file system 90261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 90361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 90461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 90561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 90661847f8eSopenharmony_ci * @throws { BusinessError } 13900021 - File table overflow 90761847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 90861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 90961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 91061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 91161847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 91261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 91361847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 91461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 91561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 91661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 91761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 91861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 91961847f8eSopenharmony_ci * @since 11 92061847f8eSopenharmony_ci */ 92161847f8eSopenharmony_cideclare function copy(srcUri: string, destUri: string, callback: AsyncCallback<void>): void; 92261847f8eSopenharmony_ci 92361847f8eSopenharmony_ci/** 92461847f8eSopenharmony_ci * Copy file or directory. 92561847f8eSopenharmony_ci * 92661847f8eSopenharmony_ci * @param { string } srcUri - src uri. 92761847f8eSopenharmony_ci * @param { string } destUri - dest uri. 92861847f8eSopenharmony_ci * @param { CopyOptions } options - options. 92961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 93061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 93161847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 93261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 93361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 93461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 93561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 93661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 93761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 93861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 93961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied by the file system 94061847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 94161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 94261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 94361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 94461847f8eSopenharmony_ci * @throws { BusinessError } 13900021 - File table overflow 94561847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 94661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 94761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 94861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 94961847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 95061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 95161847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 95261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 95361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 95461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 95561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 95661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 95761847f8eSopenharmony_ci * @since 11 95861847f8eSopenharmony_ci */ 95961847f8eSopenharmony_cideclare function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback<void>): void; 96061847f8eSopenharmony_ci 96161847f8eSopenharmony_ci/** 96261847f8eSopenharmony_ci * Copy directory. 96361847f8eSopenharmony_ci * 96461847f8eSopenharmony_ci * @param { string } src - source path. 96561847f8eSopenharmony_ci * @param { string } dest - destination path. 96661847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 96761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 96861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 96961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 97061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 97161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 97261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 97361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 97461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 97561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 97661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 97761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 97861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 97961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 98061847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 98161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 98261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 98361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 98461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 98561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 98661847f8eSopenharmony_ci * @since 10 98761847f8eSopenharmony_ci */ 98861847f8eSopenharmony_ci/** 98961847f8eSopenharmony_ci * Copy directory. 99061847f8eSopenharmony_ci * 99161847f8eSopenharmony_ci * @param { string } src - source path. 99261847f8eSopenharmony_ci * @param { string } dest - destination path. 99361847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 99461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 99561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 99661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 99761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 99861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 99961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 100061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 100161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 100261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 100361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 100461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 100561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 100661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 100761847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 100861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 100961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 101061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 101161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 101261847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 101361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 101461847f8eSopenharmony_ci * @since 12 101561847f8eSopenharmony_ci */ 101661847f8eSopenharmony_cideclare function copyDir(src: string, dest: string, mode?: number): Promise<void>; 101761847f8eSopenharmony_ci 101861847f8eSopenharmony_ci/** 101961847f8eSopenharmony_ci * Copy directory. 102061847f8eSopenharmony_ci * 102161847f8eSopenharmony_ci * @param { string } src - source path. 102261847f8eSopenharmony_ci * @param { string } dest - destination path. 102361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 102461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 102561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 102661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 102761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 102861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 102961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 103061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 103161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 103261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 103361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 103461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 103561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 103661847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 103761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 103861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 103961847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 104061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 104161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 104261847f8eSopenharmony_ci * @since 10 104361847f8eSopenharmony_ci */ 104461847f8eSopenharmony_cideclare function copyDir(src: string, dest: string, callback: AsyncCallback<void>): void; 104561847f8eSopenharmony_ci 104661847f8eSopenharmony_ci/** 104761847f8eSopenharmony_ci * Copy directory. 104861847f8eSopenharmony_ci * 104961847f8eSopenharmony_ci * @param { string } src - source path. 105061847f8eSopenharmony_ci * @param { string } dest - destination path. 105161847f8eSopenharmony_ci * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Return the callback function. 105261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 105361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 105461847f8eSopenharmony_ci * @since 10 105561847f8eSopenharmony_ci */ 105661847f8eSopenharmony_cideclare function copyDir(src: string, dest: string, callback: AsyncCallback<void, Array<ConflictFiles>>): void; 105761847f8eSopenharmony_ci 105861847f8eSopenharmony_ci 105961847f8eSopenharmony_ci/** 106061847f8eSopenharmony_ci * Copy directory. 106161847f8eSopenharmony_ci * 106261847f8eSopenharmony_ci * @param { string } src - source path. 106361847f8eSopenharmony_ci * @param { string } dest - destination path. 106461847f8eSopenharmony_ci * @param { number } mode - mode. 106561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 106661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 106761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 106861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 106961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 107061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 107161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 107261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 107361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 107461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 107561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 107661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 107761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 107861847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 107961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 108061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 108161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 108261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 108361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 108461847f8eSopenharmony_ci * @since 10 108561847f8eSopenharmony_ci */ 108661847f8eSopenharmony_cideclare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback<void>): void; 108761847f8eSopenharmony_ci 108861847f8eSopenharmony_ci/** 108961847f8eSopenharmony_ci * Copy directory. 109061847f8eSopenharmony_ci * 109161847f8eSopenharmony_ci * @param { string } src - source path. 109261847f8eSopenharmony_ci * @param { string } dest - destination path. 109361847f8eSopenharmony_ci * @param { number } mode - mode. 109461847f8eSopenharmony_ci * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Return the callback function. 109561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 109661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 109761847f8eSopenharmony_ci * @since 10 109861847f8eSopenharmony_ci */ 109961847f8eSopenharmony_cideclare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback<void, Array<ConflictFiles>>): void; 110061847f8eSopenharmony_ci 110161847f8eSopenharmony_ci/** 110261847f8eSopenharmony_ci * Copy directory with sync interface. 110361847f8eSopenharmony_ci * 110461847f8eSopenharmony_ci * @param { string } src - source path. 110561847f8eSopenharmony_ci * @param { string } dest - destination path. 110661847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 110761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 110861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 110961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 111061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 111161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 111261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 111361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 111461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 111561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 111661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 111761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 111861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 111961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 112061847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 112161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 112261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 112361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 112461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 112561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 112661847f8eSopenharmony_ci * @since 10 112761847f8eSopenharmony_ci */ 112861847f8eSopenharmony_ci/** 112961847f8eSopenharmony_ci * Copy directory with sync interface. 113061847f8eSopenharmony_ci * 113161847f8eSopenharmony_ci * @param { string } src - source path. 113261847f8eSopenharmony_ci * @param { string } dest - destination path. 113361847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 113461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 113561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 113661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 113761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 113861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 113961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 114061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 114161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 114261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 114361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 114461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 114561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 114661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 114761847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 114861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 114961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 115061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 115161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 115261847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 115361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 115461847f8eSopenharmony_ci * @since 12 115561847f8eSopenharmony_ci */ 115661847f8eSopenharmony_cideclare function copyDirSync(src: string, dest: string, mode?: number): void; 115761847f8eSopenharmony_ci 115861847f8eSopenharmony_ci/** 115961847f8eSopenharmony_ci * Copy file. 116061847f8eSopenharmony_ci * 116161847f8eSopenharmony_ci * @param { string | number } src - src. 116261847f8eSopenharmony_ci * @param { string | number } dest - dest. 116361847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 116461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 116561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 116661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 116761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 116861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 116961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 117061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 117161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 117261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 117361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 117461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 117561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 117661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 117761847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 117861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 117961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 118061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 118161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 118261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 118361847f8eSopenharmony_ci * @since 9 118461847f8eSopenharmony_ci */ 118561847f8eSopenharmony_ci/** 118661847f8eSopenharmony_ci * Copy file. 118761847f8eSopenharmony_ci * 118861847f8eSopenharmony_ci * @param { string | number } src - src. 118961847f8eSopenharmony_ci * @param { string | number } dest - dest. 119061847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 119161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 119261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 119361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 119461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 119561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 119661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 119761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 119861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 119961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 120061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 120161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 120261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 120361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 120461847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 120561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 120661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 120761847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 120861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 120961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 121061847f8eSopenharmony_ci * @crossplatform 121161847f8eSopenharmony_ci * @since 10 121261847f8eSopenharmony_ci */ 121361847f8eSopenharmony_ci/** 121461847f8eSopenharmony_ci * Copy file. 121561847f8eSopenharmony_ci * 121661847f8eSopenharmony_ci * @param { string | number } src - src. 121761847f8eSopenharmony_ci * @param { string | number } dest - dest. 121861847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 121961847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 122061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 122161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 122261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 122361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 122461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 122561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 122661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 122761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 122861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 122961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 123061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 123161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 123261847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 123361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 123461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 123561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 123661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 123761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 123861847f8eSopenharmony_ci * @crossplatform 123961847f8eSopenharmony_ci * @atomicservice 124061847f8eSopenharmony_ci * @since 11 124161847f8eSopenharmony_ci */ 124261847f8eSopenharmony_ci/** 124361847f8eSopenharmony_ci * Copy file. 124461847f8eSopenharmony_ci * 124561847f8eSopenharmony_ci * @param { string | number } src - src. 124661847f8eSopenharmony_ci * @param { string | number } dest - dest. 124761847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 124861847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 124961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 125061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 125161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 125261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 125361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 125461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 125561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 125661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 125761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 125861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 125961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 126061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 126161847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 126261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 126361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 126461847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 126561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 126661847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 126761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 126861847f8eSopenharmony_ci * @crossplatform 126961847f8eSopenharmony_ci * @atomicservice 127061847f8eSopenharmony_ci * @since 12 127161847f8eSopenharmony_ci */ 127261847f8eSopenharmony_cideclare function copyFile(src: string | number, dest: string | number, mode?: number): Promise<void>; 127361847f8eSopenharmony_ci 127461847f8eSopenharmony_ci/** 127561847f8eSopenharmony_ci * Copy file. 127661847f8eSopenharmony_ci * 127761847f8eSopenharmony_ci * @param { string | number } src - src. 127861847f8eSopenharmony_ci * @param { string | number } dest - dest. 127961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 128061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 128161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 128261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 128361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 128461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 128561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 128661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 128761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 128861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 128961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 129061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 129161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 129261847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 129361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 129461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 129561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 129661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 129761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 129861847f8eSopenharmony_ci * @since 9 129961847f8eSopenharmony_ci */ 130061847f8eSopenharmony_ci/** 130161847f8eSopenharmony_ci * Copy file. 130261847f8eSopenharmony_ci * 130361847f8eSopenharmony_ci * @param { string | number } src - src. 130461847f8eSopenharmony_ci * @param { string | number } dest - dest. 130561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 130661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 130761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 130861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 130961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 131061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 131161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 131261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 131361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 131461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 131561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 131661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 131761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 131861847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 131961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 132061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 132161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 132261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 132361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 132461847f8eSopenharmony_ci * @crossplatform 132561847f8eSopenharmony_ci * @since 10 132661847f8eSopenharmony_ci */ 132761847f8eSopenharmony_ci/** 132861847f8eSopenharmony_ci * Copy file. 132961847f8eSopenharmony_ci * 133061847f8eSopenharmony_ci * @param { string | number } src - src. 133161847f8eSopenharmony_ci * @param { string | number } dest - dest. 133261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 133361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 133461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 133561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 133661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 133761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 133861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 133961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 134061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 134161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 134261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 134361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 134461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 134561847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 134661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 134761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 134861847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 134961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 135061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 135161847f8eSopenharmony_ci * @crossplatform 135261847f8eSopenharmony_ci * @atomicservice 135361847f8eSopenharmony_ci * @since 11 135461847f8eSopenharmony_ci */ 135561847f8eSopenharmony_cideclare function copyFile(src: string | number, dest: string | number, callback: AsyncCallback<void>): void; 135661847f8eSopenharmony_ci 135761847f8eSopenharmony_ci/** 135861847f8eSopenharmony_ci * Copy file. 135961847f8eSopenharmony_ci * 136061847f8eSopenharmony_ci * @param { string | number } src - src. 136161847f8eSopenharmony_ci * @param { string | number } dest - dest. 136261847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 136361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 136461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 136561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 136661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 136761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 136861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 136961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 137061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 137161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 137261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 137361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 137461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 137561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 137661847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 137761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 137861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 137961847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 138061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 138161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 138261847f8eSopenharmony_ci * @since 9 138361847f8eSopenharmony_ci */ 138461847f8eSopenharmony_ci/** 138561847f8eSopenharmony_ci * Copy file. 138661847f8eSopenharmony_ci * 138761847f8eSopenharmony_ci * @param { string | number } src - src. 138861847f8eSopenharmony_ci * @param { string | number } dest - dest. 138961847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 139061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 139161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 139261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 139361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 139461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 139561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 139661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 139761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 139861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 139961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 140061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 140161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 140261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 140361847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 140461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 140561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 140661847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 140761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 140861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 140961847f8eSopenharmony_ci * @crossplatform 141061847f8eSopenharmony_ci * @since 10 141161847f8eSopenharmony_ci */ 141261847f8eSopenharmony_ci/** 141361847f8eSopenharmony_ci * Copy file. 141461847f8eSopenharmony_ci * 141561847f8eSopenharmony_ci * @param { string | number } src - src. 141661847f8eSopenharmony_ci * @param { string | number } dest - dest. 141761847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 141861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 141961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 142061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 142161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 142261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 142361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 142461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 142561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 142661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 142761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 142861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 142961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 143061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 143161847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 143261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 143361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 143461847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 143561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 143661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 143761847f8eSopenharmony_ci * @crossplatform 143861847f8eSopenharmony_ci * @atomicservice 143961847f8eSopenharmony_ci * @since 11 144061847f8eSopenharmony_ci */ 144161847f8eSopenharmony_cideclare function copyFile( 144261847f8eSopenharmony_ci src: string | number, 144361847f8eSopenharmony_ci dest: string | number, 144461847f8eSopenharmony_ci mode: number, 144561847f8eSopenharmony_ci callback: AsyncCallback<void> 144661847f8eSopenharmony_ci): void; 144761847f8eSopenharmony_ci 144861847f8eSopenharmony_ci/** 144961847f8eSopenharmony_ci * Copy file with sync interface. 145061847f8eSopenharmony_ci * 145161847f8eSopenharmony_ci * @param { string | number } src - src. 145261847f8eSopenharmony_ci * @param { string | number } dest - dest. 145361847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 145461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 145561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 145661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 145761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 145861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 145961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 146061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 146161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 146261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 146361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 146461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 146561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 146661847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 146761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 146861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 146961847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 147061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 147161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 147261847f8eSopenharmony_ci * @since 9 147361847f8eSopenharmony_ci */ 147461847f8eSopenharmony_ci/** 147561847f8eSopenharmony_ci * Copy file with sync interface. 147661847f8eSopenharmony_ci * 147761847f8eSopenharmony_ci * @param { string | number } src - src. 147861847f8eSopenharmony_ci * @param { string | number } dest - dest. 147961847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 148061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 148161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 148261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 148361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 148461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 148561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 148661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 148761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 148861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 148961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 149061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 149161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 149261847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 149361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 149461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 149561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 149661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 149761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 149861847f8eSopenharmony_ci * @crossplatform 149961847f8eSopenharmony_ci * @since 10 150061847f8eSopenharmony_ci */ 150161847f8eSopenharmony_ci/** 150261847f8eSopenharmony_ci * Copy file with sync interface. 150361847f8eSopenharmony_ci * 150461847f8eSopenharmony_ci * @param { string | number } src - src. 150561847f8eSopenharmony_ci * @param { string | number } dest - dest. 150661847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 150761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 150861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 150961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 151061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 151161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 151261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 151361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 151461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 151561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 151661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 151761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 151861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 151961847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 152061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 152161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 152261847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 152361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 152461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 152561847f8eSopenharmony_ci * @crossplatform 152661847f8eSopenharmony_ci * @atomicservice 152761847f8eSopenharmony_ci * @since 11 152861847f8eSopenharmony_ci */ 152961847f8eSopenharmony_ci/** 153061847f8eSopenharmony_ci * Copy file with sync interface. 153161847f8eSopenharmony_ci * 153261847f8eSopenharmony_ci * @param { string | number } src - src. 153361847f8eSopenharmony_ci * @param { string | number } dest - dest. 153461847f8eSopenharmony_ci * @param { number } [mode = 0] - mode. 153561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 153661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 153761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 153861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 153961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 154061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 154161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 154261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 154361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 154461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 154561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 154661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 154761847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 154861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 154961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 155061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 155161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 155261847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 155361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 155461847f8eSopenharmony_ci * @crossplatform 155561847f8eSopenharmony_ci * @atomicservice 155661847f8eSopenharmony_ci * @since 12 155761847f8eSopenharmony_ci */ 155861847f8eSopenharmony_cideclare function copyFileSync(src: string | number, dest: string | number, mode?: number): void; 155961847f8eSopenharmony_ci 156061847f8eSopenharmony_ci/** 156161847f8eSopenharmony_ci * Create class Stream. 156261847f8eSopenharmony_ci * 156361847f8eSopenharmony_ci * @param { string } path - path. 156461847f8eSopenharmony_ci * @param { string } mode - mode. 156561847f8eSopenharmony_ci * @returns { Promise<Stream> } return Promise 156661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 156761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 156861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 156961847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 157061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 157161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 157261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 157361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 157461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 157561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 157661847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 157761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 157861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 157961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 158061847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 158161847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 158261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 158361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 158461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 158561847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 158661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 158761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 158861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 158961847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 159061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 159161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 159261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 159361847f8eSopenharmony_ci * @since 9 159461847f8eSopenharmony_ci */ 159561847f8eSopenharmony_ci/** 159661847f8eSopenharmony_ci * Create class Stream. 159761847f8eSopenharmony_ci * 159861847f8eSopenharmony_ci * @param { string } path - path. 159961847f8eSopenharmony_ci * @param { string } mode - mode. 160061847f8eSopenharmony_ci * @returns { Promise<Stream> } return Promise 160161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 160261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 160361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 160461847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 160561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 160661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 160761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 160861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 160961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 161061847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 161161847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 161261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 161361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 161461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 161561847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 161661847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 161761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 161861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 161961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 162061847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 162161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 162261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 162361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 162461847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 162561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 162661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 162761847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 162861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 162961847f8eSopenharmony_ci * @since 12 163061847f8eSopenharmony_ci */ 163161847f8eSopenharmony_cideclare function createStream(path: string, mode: string): Promise<Stream>; 163261847f8eSopenharmony_ci 163361847f8eSopenharmony_ci/** 163461847f8eSopenharmony_ci * Create class Stream. 163561847f8eSopenharmony_ci * 163661847f8eSopenharmony_ci * @param { string } path - path. 163761847f8eSopenharmony_ci * @param { string } mode - mode. 163861847f8eSopenharmony_ci * @param { AsyncCallback<Stream> } callback - callback. 163961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 164061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 164161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 164261847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 164361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 164461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 164561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 164661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 164761847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 164861847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 164961847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 165061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 165161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 165261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 165361847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 165461847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 165561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 165661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 165761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 165861847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 165961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 166061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 166161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 166261847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 166361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 166461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 166561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 166661847f8eSopenharmony_ci * @since 9 166761847f8eSopenharmony_ci */ 166861847f8eSopenharmony_cideclare function createStream(path: string, mode: string, callback: AsyncCallback<Stream>): void; 166961847f8eSopenharmony_ci 167061847f8eSopenharmony_ci/** 167161847f8eSopenharmony_ci * Create class Stream with sync interface. 167261847f8eSopenharmony_ci * 167361847f8eSopenharmony_ci * @param { string } path - path. 167461847f8eSopenharmony_ci * @param { string } mode - mode. 167561847f8eSopenharmony_ci * @returns { Stream } createStream 167661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 167761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 167861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 167961847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 168061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 168161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 168261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 168361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 168461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 168561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 168661847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 168761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 168861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 168961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 169061847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 169161847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 169261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 169361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 169461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 169561847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 169661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 169761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 169861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 169961847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 170061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 170161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 170261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 170361847f8eSopenharmony_ci * @since 9 170461847f8eSopenharmony_ci */ 170561847f8eSopenharmony_ci/** 170661847f8eSopenharmony_ci * Create class Stream with sync interface. 170761847f8eSopenharmony_ci * 170861847f8eSopenharmony_ci * @param { string } path - path. 170961847f8eSopenharmony_ci * @param { string } mode - mode. 171061847f8eSopenharmony_ci * @returns { Stream } createStream 171161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 171261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 171361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 171461847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 171561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 171661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 171761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 171861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 171961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 172061847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 172161847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 172261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 172361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 172461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 172561847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 172661847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 172761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 172861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 172961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 173061847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 173161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 173261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 173361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 173461847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 173561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 173661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 173761847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 173861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 173961847f8eSopenharmony_ci * @since 12 174061847f8eSopenharmony_ci */ 174161847f8eSopenharmony_cideclare function createStreamSync(path: string, mode: string): Stream; 174261847f8eSopenharmony_ci 174361847f8eSopenharmony_ci 174461847f8eSopenharmony_ci/** 174561847f8eSopenharmony_ci * Create class RandomAccessFile. 174661847f8eSopenharmony_ci * 174761847f8eSopenharmony_ci * @param { string | File } file - file path, object. 174861847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 174961847f8eSopenharmony_ci * @returns { Promise<RandomAccessFile> } Returns the RandomAccessFile object which has been created in promise mode. 175061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 175161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 175261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 175361847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 175461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 175561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 175661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 175761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 175861847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 175961847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 176061847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 176161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 176261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 176361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 176461847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 176561847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 176661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 176761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 176861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 176961847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 177061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 177161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 177261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 177361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 177461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 177561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 177661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 177761847f8eSopenharmony_ci * @since 10 177861847f8eSopenharmony_ci */ 177961847f8eSopenharmony_ci/** 178061847f8eSopenharmony_ci * Create class RandomAccessFile. 178161847f8eSopenharmony_ci * 178261847f8eSopenharmony_ci * @param { string | File } file - file path, object. 178361847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 178461847f8eSopenharmony_ci * @param { RandomAccessFileOptions } [options] - RandomAccessFile options 178561847f8eSopenharmony_ci * @returns { Promise<RandomAccessFile> } Returns the RandomAccessFile object which has been created in promise mode. 178661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 178761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 178861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 178961847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 179061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 179161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 179261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 179361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 179461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 179561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 179661847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 179761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 179861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 179961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 180061847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 180161847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 180261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 180361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 180461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 180561847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 180661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 180761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 180861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 180961847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 181061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 181161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 181261847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 181361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 181461847f8eSopenharmony_ci * @since 12 181561847f8eSopenharmony_ci */ 181661847f8eSopenharmony_cideclare function createRandomAccessFile(file: string | File, mode?: number, 181761847f8eSopenharmony_ci options?: RandomAccessFileOptions): Promise<RandomAccessFile>; 181861847f8eSopenharmony_ci 181961847f8eSopenharmony_ci/** 182061847f8eSopenharmony_ci * Create class RandomAccessFile. 182161847f8eSopenharmony_ci * 182261847f8eSopenharmony_ci * @param { string | File } file - file path, object. 182361847f8eSopenharmony_ci * @param { AsyncCallback<RandomAccessFile> } callback - The callback is used to return the RandomAccessFile object which has been created. 182461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 182561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 182661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 182761847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 182861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 182961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 183061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 183161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 183261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 183361847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 183461847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 183561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 183661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 183761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 183861847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 183961847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 184061847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 184161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 184261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 184361847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 184461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 184561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 184661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 184761847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 184861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 184961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 185061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 185161847f8eSopenharmony_ci * @since 10 185261847f8eSopenharmony_ci */ 185361847f8eSopenharmony_cideclare function createRandomAccessFile(file: string | File, callback: AsyncCallback<RandomAccessFile>): void; 185461847f8eSopenharmony_ci 185561847f8eSopenharmony_ci/** 185661847f8eSopenharmony_ci * Create class RandomAccessFile. 185761847f8eSopenharmony_ci * 185861847f8eSopenharmony_ci * @param { string | File } file - file path, object. 185961847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 186061847f8eSopenharmony_ci * @param { AsyncCallback<RandomAccessFile> } callback - The callback is used to return the RandomAccessFile object which has been created. 186161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 186261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 186361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 186461847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 186561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 186661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 186761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 186861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 186961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 187061847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 187161847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 187261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 187361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 187461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 187561847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 187661847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 187761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 187861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 187961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 188061847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 188161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 188261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 188361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 188461847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 188561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 188661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 188761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 188861847f8eSopenharmony_ci * @since 10 188961847f8eSopenharmony_ci */ 189061847f8eSopenharmony_cideclare function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback<RandomAccessFile>): void; 189161847f8eSopenharmony_ci 189261847f8eSopenharmony_ci/** 189361847f8eSopenharmony_ci * Create class RandomAccessFile with sync interface. 189461847f8eSopenharmony_ci * 189561847f8eSopenharmony_ci * @param { string | File } file - file path, object. 189661847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 189761847f8eSopenharmony_ci * @returns { RandomAccessFile } Returns the RandomAccessFile object which has been created. 189861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 189961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 190061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 190161847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 190261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 190361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 190461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 190561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 190661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 190761847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 190861847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 190961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 191061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 191161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 191261847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 191361847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 191461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 191561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 191661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 191761847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 191861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 191961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 192061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 192161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 192261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 192361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 192461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 192561847f8eSopenharmony_ci * @since 10 192661847f8eSopenharmony_ci */ 192761847f8eSopenharmony_ci/** 192861847f8eSopenharmony_ci * Create class RandomAccessFile with sync interface. 192961847f8eSopenharmony_ci * 193061847f8eSopenharmony_ci * @param { string | File } file - file path, object. 193161847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 193261847f8eSopenharmony_ci * @param { RandomAccessFileOptions } [options] - RandomAccessFile options 193361847f8eSopenharmony_ci * @returns { RandomAccessFile } Returns the RandomAccessFile object which has been created. 193461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 193561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 193661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 193761847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 193861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 193961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 194061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 194161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 194261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 194361847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 194461847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 194561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 194661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 194761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 194861847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 194961847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 195061847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 195161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 195261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 195361847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 195461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 195561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 195661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 195761847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 195861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 195961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 196061847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 196161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 196261847f8eSopenharmony_ci * @since 12 196361847f8eSopenharmony_ci */ 196461847f8eSopenharmony_cideclare function createRandomAccessFileSync(file: string | File, mode?: number, 196561847f8eSopenharmony_ci options?: RandomAccessFileOptions): RandomAccessFile; 196661847f8eSopenharmony_ci 196761847f8eSopenharmony_ci/** 196861847f8eSopenharmony_ci * Create file read stream. 196961847f8eSopenharmony_ci * 197061847f8eSopenharmony_ci * @param { string } path - file path. 197161847f8eSopenharmony_ci * @param { ReadStreamOptions } [options] - Optional parameters for ReadStream. 197261847f8eSopenharmony_ci * @returns { ReadStream } Returns the ReadStream object which has been created. 197361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error 197461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 197561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 197661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 197761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 197861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 197961847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 198061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 198161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 198261847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 198361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 198461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 198561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 198661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 198761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 198861847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 198961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 199061847f8eSopenharmony_ci * @since 12 199161847f8eSopenharmony_ci */ 199261847f8eSopenharmony_cideclare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; 199361847f8eSopenharmony_ci 199461847f8eSopenharmony_ci/** 199561847f8eSopenharmony_ci * Create file write stream. 199661847f8eSopenharmony_ci * 199761847f8eSopenharmony_ci * @param { string } path - file path. 199861847f8eSopenharmony_ci * @param { WriteStreamOptions } [options] - Optional parameters for ReadStream. 199961847f8eSopenharmony_ci * @returns { WriteStream } Returns the WriteStream object which has been created. 200061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error 200161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 200261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 200361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 200461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 200561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 200661847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 200761847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 200861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 200961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 201061847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 201161847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 201261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 201361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 201461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 201561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 201661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 201761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 201861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 201961847f8eSopenharmony_ci * @since 12 202061847f8eSopenharmony_ci */ 202161847f8eSopenharmony_cideclare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; 202261847f8eSopenharmony_ci 202361847f8eSopenharmony_ci/** 202461847f8eSopenharmony_ci * Create watcher to listen for file changes. 202561847f8eSopenharmony_ci * 202661847f8eSopenharmony_ci * @param { string } path - path. 202761847f8eSopenharmony_ci * @param { number } events - listened events. 202861847f8eSopenharmony_ci * @param { WatchEventListener } listener - Callback to invoke when an event of the specified type occurs. 202961847f8eSopenharmony_ci * @returns { Watcher } Returns the Watcher object which has been created. 203061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 203161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 203261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 203361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 203461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 203561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 203661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 203761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 203861847f8eSopenharmony_ci * @throws { BusinessError } 13900021 - File table overflow 203961847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 204061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 204161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 204261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 204361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 204461847f8eSopenharmony_ci * @since 10 204561847f8eSopenharmony_ci */ 204661847f8eSopenharmony_cideclare function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; 204761847f8eSopenharmony_ci 204861847f8eSopenharmony_ci/** 204961847f8eSopenharmony_ci * Duplicate fd to File Object. 205061847f8eSopenharmony_ci * 205161847f8eSopenharmony_ci * @param { number } fd - fd. 205261847f8eSopenharmony_ci * @returns { File } return File 205361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 205461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 205561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 205661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 205761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 205861847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 205961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 206061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 206161847f8eSopenharmony_ci * @since 10 206261847f8eSopenharmony_ci */ 206361847f8eSopenharmony_cideclare function dup(fd: number): File; 206461847f8eSopenharmony_ci 206561847f8eSopenharmony_ci/** 206661847f8eSopenharmony_ci * Synchronize file metadata. 206761847f8eSopenharmony_ci * 206861847f8eSopenharmony_ci * @param { number } fd - fd. 206961847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 207061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 207161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 207261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 207361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 207461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 207561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 207661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 207761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 207861847f8eSopenharmony_ci * @since 9 207961847f8eSopenharmony_ci */ 208061847f8eSopenharmony_ci/** 208161847f8eSopenharmony_ci * Synchronize file metadata. 208261847f8eSopenharmony_ci * 208361847f8eSopenharmony_ci * @param { number } fd - fd. 208461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 208561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 208661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 208761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 208861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 208961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 209061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 209161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 209261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 209361847f8eSopenharmony_ci * @crossplatform 209461847f8eSopenharmony_ci * @since 10 209561847f8eSopenharmony_ci */ 209661847f8eSopenharmony_cideclare function fdatasync(fd: number): Promise<void>; 209761847f8eSopenharmony_ci 209861847f8eSopenharmony_ci/** 209961847f8eSopenharmony_ci * Synchronize file metadata. 210061847f8eSopenharmony_ci * 210161847f8eSopenharmony_ci * @param { number } fd - fd. 210261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 210361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 210461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 210561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 210661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 210761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 210861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 210961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 211061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 211161847f8eSopenharmony_ci * @since 9 211261847f8eSopenharmony_ci */ 211361847f8eSopenharmony_ci/** 211461847f8eSopenharmony_ci * Synchronize file metadata. 211561847f8eSopenharmony_ci * 211661847f8eSopenharmony_ci * @param { number } fd - fd. 211761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 211861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 211961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 212061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 212161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 212261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 212361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 212461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 212561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 212661847f8eSopenharmony_ci * @crossplatform 212761847f8eSopenharmony_ci * @since 10 212861847f8eSopenharmony_ci */ 212961847f8eSopenharmony_cideclare function fdatasync(fd: number, callback: AsyncCallback<void>): void; 213061847f8eSopenharmony_ci 213161847f8eSopenharmony_ci/** 213261847f8eSopenharmony_ci * Synchronize file metadata with sync interface. 213361847f8eSopenharmony_ci * 213461847f8eSopenharmony_ci * @param { number } fd - fd. 213561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 213661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 213761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 213861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 213961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 214061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 214161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 214261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 214361847f8eSopenharmony_ci * @since 9 214461847f8eSopenharmony_ci */ 214561847f8eSopenharmony_ci/** 214661847f8eSopenharmony_ci * Synchronize file metadata with sync interface. 214761847f8eSopenharmony_ci * 214861847f8eSopenharmony_ci * @param { number } fd - fd. 214961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 215061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 215161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 215261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 215361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 215461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 215561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 215661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 215761847f8eSopenharmony_ci * @crossplatform 215861847f8eSopenharmony_ci * @since 10 215961847f8eSopenharmony_ci */ 216061847f8eSopenharmony_cideclare function fdatasyncSync(fd: number): void; 216161847f8eSopenharmony_ci 216261847f8eSopenharmony_ci/** 216361847f8eSopenharmony_ci * Create class Stream by using fd. 216461847f8eSopenharmony_ci * 216561847f8eSopenharmony_ci * @param { number } fd - fd. 216661847f8eSopenharmony_ci * @param { string } mode - mode. 216761847f8eSopenharmony_ci * @returns { Promise<Stream> } Returns the Stream object in promise mode. 216861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 216961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 217061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 217161847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 217261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 217361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 217461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 217561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 217661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 217761847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 217861847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 217961847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 218061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 218161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 218261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 218361847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 218461847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 218561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 218661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 218761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 218861847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 218961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 219061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 219161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 219261847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 219361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 219461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 219561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 219661847f8eSopenharmony_ci * @since 9 219761847f8eSopenharmony_ci */ 219861847f8eSopenharmony_cideclare function fdopenStream(fd: number, mode: string): Promise<Stream>; 219961847f8eSopenharmony_ci 220061847f8eSopenharmony_ci/** 220161847f8eSopenharmony_ci * Create class Stream by using fd. 220261847f8eSopenharmony_ci * 220361847f8eSopenharmony_ci * @param { number } fd - fd. 220461847f8eSopenharmony_ci * @param { string } mode - mode. 220561847f8eSopenharmony_ci * @param { AsyncCallback<Stream> } callback - The callback is used to return the Stream object. 220661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 220761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 220861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 220961847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 221061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 221161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 221261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 221361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 221461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 221561847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 221661847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 221761847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 221861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 221961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 222061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 222161847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 222261847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 222361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 222461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 222561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 222661847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 222761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 222861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 222961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 223061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 223161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 223261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 223361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 223461847f8eSopenharmony_ci * @since 9 223561847f8eSopenharmony_ci */ 223661847f8eSopenharmony_cideclare function fdopenStream(fd: number, mode: string, callback: AsyncCallback<Stream>): void; 223761847f8eSopenharmony_ci 223861847f8eSopenharmony_ci/** 223961847f8eSopenharmony_ci * Create class Stream by using fd with sync interface. 224061847f8eSopenharmony_ci * 224161847f8eSopenharmony_ci * @param { number } fd - fd. 224261847f8eSopenharmony_ci * @param { string } mode - mode. 224361847f8eSopenharmony_ci * @returns { Stream } Returns the Stream object. 224461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 224561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 224661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 224761847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 224861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 224961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 225061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 225161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 225261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 225361847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 225461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 225561847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 225661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 225761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 225861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 225961847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 226061847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 226161847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 226261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 226361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 226461847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 226561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 226661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 226761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 226861847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 226961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 227061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 227161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 227261847f8eSopenharmony_ci * @since 9 227361847f8eSopenharmony_ci */ 227461847f8eSopenharmony_cideclare function fdopenStreamSync(fd: number, mode: string): Stream; 227561847f8eSopenharmony_ci 227661847f8eSopenharmony_ci/** 227761847f8eSopenharmony_ci * Synchronize file. 227861847f8eSopenharmony_ci * 227961847f8eSopenharmony_ci * @param { number } fd - fd. 228061847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 228161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 228261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 228361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 228461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 228561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 228661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 228761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 228861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 228961847f8eSopenharmony_ci * @since 9 229061847f8eSopenharmony_ci */ 229161847f8eSopenharmony_ci/** 229261847f8eSopenharmony_ci * Synchronize file. 229361847f8eSopenharmony_ci * 229461847f8eSopenharmony_ci * @param { number } fd - fd. 229561847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 229661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 229761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 229861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 229961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 230061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 230161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 230261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 230361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 230461847f8eSopenharmony_ci * @crossplatform 230561847f8eSopenharmony_ci * @since 10 230661847f8eSopenharmony_ci */ 230761847f8eSopenharmony_cideclare function fsync(fd: number): Promise<void>; 230861847f8eSopenharmony_ci 230961847f8eSopenharmony_ci/** 231061847f8eSopenharmony_ci * Synchronize file. 231161847f8eSopenharmony_ci * 231261847f8eSopenharmony_ci * @param { number } fd - fd. 231361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 231461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 231561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 231661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 231761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 231861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 231961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 232061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 232161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 232261847f8eSopenharmony_ci * @since 9 232361847f8eSopenharmony_ci */ 232461847f8eSopenharmony_ci/** 232561847f8eSopenharmony_ci * Synchronize file. 232661847f8eSopenharmony_ci * 232761847f8eSopenharmony_ci * @param { number } fd - fd. 232861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 232961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 233061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 233161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 233261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 233361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 233461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 233561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 233661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 233761847f8eSopenharmony_ci * @crossplatform 233861847f8eSopenharmony_ci * @since 10 233961847f8eSopenharmony_ci */ 234061847f8eSopenharmony_cideclare function fsync(fd: number, callback: AsyncCallback<void>): void; 234161847f8eSopenharmony_ci 234261847f8eSopenharmony_ci/** 234361847f8eSopenharmony_ci * Synchronize file with sync interface. 234461847f8eSopenharmony_ci * 234561847f8eSopenharmony_ci * @param { number } fd - fd. 234661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 234761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 234861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 234961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 235061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 235161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 235261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 235361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 235461847f8eSopenharmony_ci * @since 9 235561847f8eSopenharmony_ci */ 235661847f8eSopenharmony_ci/** 235761847f8eSopenharmony_ci * Synchronize file with sync interface. 235861847f8eSopenharmony_ci * 235961847f8eSopenharmony_ci * @param { number } fd - fd. 236061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 236161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 236261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 236361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 236461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 236561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 236661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 236761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 236861847f8eSopenharmony_ci * @crossplatform 236961847f8eSopenharmony_ci * @since 10 237061847f8eSopenharmony_ci */ 237161847f8eSopenharmony_cideclare function fsyncSync(fd: number): void; 237261847f8eSopenharmony_ci 237361847f8eSopenharmony_ci/** 237461847f8eSopenharmony_ci * List file. 237561847f8eSopenharmony_ci * 237661847f8eSopenharmony_ci * @param { string } path - path. 237761847f8eSopenharmony_ci * @param { object } [options] - options. 237861847f8eSopenharmony_ci * @returns { Promise<string[]> } Returns an Array containing the name of files or directories that meet the filter criteria in promise mode. 237961847f8eSopenharmony_ci * If present, Include the subdirectory structure. 238061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 238161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 238261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 238361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 238461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 238561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 238661847f8eSopenharmony_ci * @since 9 238761847f8eSopenharmony_ci */ 238861847f8eSopenharmony_ci/** 238961847f8eSopenharmony_ci * List file. 239061847f8eSopenharmony_ci * 239161847f8eSopenharmony_ci * @param { string } path - path. 239261847f8eSopenharmony_ci * @param { object } [options] - options. 239361847f8eSopenharmony_ci * @returns { Promise<string[]> } Returns an Array containing the name of files or directories that meet the filter criteria. 239461847f8eSopenharmony_ci * If present, Include the subdirectory structure. 239561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 239661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 239761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 239861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 239961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 240061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 240161847f8eSopenharmony_ci * @crossplatform 240261847f8eSopenharmony_ci * @since 10 240361847f8eSopenharmony_ci */ 240461847f8eSopenharmony_ci/** 240561847f8eSopenharmony_ci * List file. 240661847f8eSopenharmony_ci * 240761847f8eSopenharmony_ci * @param { string } path - path. 240861847f8eSopenharmony_ci * @param { ListFileOptions } [options] - options. 240961847f8eSopenharmony_ci * @returns { Promise<string[]> } Returns an Array containing the name of files or directories that meet the filter criteria. 241061847f8eSopenharmony_ci * If present, Include the subdirectory structure. 241161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 241261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 241361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 241461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 241561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 241661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 241761847f8eSopenharmony_ci * @crossplatform 241861847f8eSopenharmony_ci * @atomicservice 241961847f8eSopenharmony_ci * @since 11 242061847f8eSopenharmony_ci */ 242161847f8eSopenharmony_cideclare function listFile( 242261847f8eSopenharmony_ci path: string, 242361847f8eSopenharmony_ci options?: ListFileOptions 242461847f8eSopenharmony_ci): Promise<string[]>; 242561847f8eSopenharmony_ci 242661847f8eSopenharmony_ci/** 242761847f8eSopenharmony_ci * List file. 242861847f8eSopenharmony_ci * 242961847f8eSopenharmony_ci * @param { string } path - path. 243061847f8eSopenharmony_ci * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories 243161847f8eSopenharmony_ci * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. 243261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 243361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 243461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 243561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 243661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 243761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 243861847f8eSopenharmony_ci * @since 9 243961847f8eSopenharmony_ci */ 244061847f8eSopenharmony_ci/** 244161847f8eSopenharmony_ci * List file. 244261847f8eSopenharmony_ci * 244361847f8eSopenharmony_ci * @param { string } path - path. 244461847f8eSopenharmony_ci * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories 244561847f8eSopenharmony_ci * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. 244661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 244761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 244861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 244961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 245061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 245161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 245261847f8eSopenharmony_ci * @crossplatform 245361847f8eSopenharmony_ci * @since 10 245461847f8eSopenharmony_ci */ 245561847f8eSopenharmony_ci/** 245661847f8eSopenharmony_ci * List file. 245761847f8eSopenharmony_ci * 245861847f8eSopenharmony_ci * @param { string } path - path. 245961847f8eSopenharmony_ci * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories 246061847f8eSopenharmony_ci * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. 246161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 246261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 246361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 246461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 246561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 246661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 246761847f8eSopenharmony_ci * @crossplatform 246861847f8eSopenharmony_ci * @atomicservice 246961847f8eSopenharmony_ci * @since 11 247061847f8eSopenharmony_ci */ 247161847f8eSopenharmony_cideclare function listFile(path: string, callback: AsyncCallback<string[]>): void; 247261847f8eSopenharmony_ci 247361847f8eSopenharmony_ci/** 247461847f8eSopenharmony_ci * List file. 247561847f8eSopenharmony_ci * 247661847f8eSopenharmony_ci * @param { string } path - path. 247761847f8eSopenharmony_ci * @param { object } [options] - options. 247861847f8eSopenharmony_ci * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories 247961847f8eSopenharmony_ci * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. 248061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 248161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 248261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 248361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 248461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 248561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 248661847f8eSopenharmony_ci * @since 9 248761847f8eSopenharmony_ci */ 248861847f8eSopenharmony_ci/** 248961847f8eSopenharmony_ci * List file. 249061847f8eSopenharmony_ci * 249161847f8eSopenharmony_ci * @param { string } path - path. 249261847f8eSopenharmony_ci * @param { object } [options] - options. 249361847f8eSopenharmony_ci * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories 249461847f8eSopenharmony_ci * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. 249561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 249661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 249761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 249861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 249961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 250061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 250161847f8eSopenharmony_ci * @crossplatform 250261847f8eSopenharmony_ci * @since 10 250361847f8eSopenharmony_ci */ 250461847f8eSopenharmony_ci/** 250561847f8eSopenharmony_ci * List file. 250661847f8eSopenharmony_ci * 250761847f8eSopenharmony_ci * @param { string } path - path. 250861847f8eSopenharmony_ci * @param { ListFileOptions } [options] - options. 250961847f8eSopenharmony_ci * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories 251061847f8eSopenharmony_ci * that meet the filter criteria in promise mode. If present, Include the subdirectory structure. 251161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 251261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 251361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 251461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 251561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 251661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 251761847f8eSopenharmony_ci * @crossplatform 251861847f8eSopenharmony_ci * @atomicservice 251961847f8eSopenharmony_ci * @since 11 252061847f8eSopenharmony_ci */ 252161847f8eSopenharmony_cideclare function listFile( 252261847f8eSopenharmony_ci path: string, 252361847f8eSopenharmony_ci options: ListFileOptions, 252461847f8eSopenharmony_ci callback: AsyncCallback<string[]> 252561847f8eSopenharmony_ci): void; 252661847f8eSopenharmony_ci 252761847f8eSopenharmony_ci/** 252861847f8eSopenharmony_ci * List file with sync interface. 252961847f8eSopenharmony_ci * 253061847f8eSopenharmony_ci * @param { string } path - path. 253161847f8eSopenharmony_ci * @param { object } [options] - options. 253261847f8eSopenharmony_ci * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. 253361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 253461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 253561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 253661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 253761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 253861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 253961847f8eSopenharmony_ci * @since 9 254061847f8eSopenharmony_ci */ 254161847f8eSopenharmony_ci/** 254261847f8eSopenharmony_ci * List file with sync interface. 254361847f8eSopenharmony_ci * 254461847f8eSopenharmony_ci * @param { string } path - path. 254561847f8eSopenharmony_ci * @param { object } [options] - options. 254661847f8eSopenharmony_ci * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. 254761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 254861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 254961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 255061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 255161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 255261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 255361847f8eSopenharmony_ci * @crossplatform 255461847f8eSopenharmony_ci * @since 10 255561847f8eSopenharmony_ci */ 255661847f8eSopenharmony_ci/** 255761847f8eSopenharmony_ci * List file with sync interface. 255861847f8eSopenharmony_ci * 255961847f8eSopenharmony_ci * @param { string } path - path. 256061847f8eSopenharmony_ci * @param { ListFileOptions } [options] - options. 256161847f8eSopenharmony_ci * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria. 256261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 256361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 256461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 256561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 256661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 256761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 256861847f8eSopenharmony_ci * @crossplatform 256961847f8eSopenharmony_ci * @atomicservice 257061847f8eSopenharmony_ci * @since 11 257161847f8eSopenharmony_ci */ 257261847f8eSopenharmony_cideclare function listFileSync( 257361847f8eSopenharmony_ci path: string, 257461847f8eSopenharmony_ci options?: ListFileOptions 257561847f8eSopenharmony_ci): string[]; 257661847f8eSopenharmony_ci 257761847f8eSopenharmony_ci/** 257861847f8eSopenharmony_ci * Reposition file offset. 257961847f8eSopenharmony_ci * 258061847f8eSopenharmony_ci * @param { number } fd - file descriptor. 258161847f8eSopenharmony_ci * @param { number } offset - file offset. 258261847f8eSopenharmony_ci * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. 258361847f8eSopenharmony_ci * @returns { number } Returns the file offset relative to starting position of file. 258461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 258561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 258661847f8eSopenharmony_ci * @throws { BusinessError } 13900026 - Illegal seek 258761847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 258861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 258961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 259061847f8eSopenharmony_ci * @since 11 259161847f8eSopenharmony_ci */ 259261847f8eSopenharmony_ci/** 259361847f8eSopenharmony_ci * Reposition file offset. 259461847f8eSopenharmony_ci * 259561847f8eSopenharmony_ci * @param { number } fd - file descriptor. 259661847f8eSopenharmony_ci * @param { number } offset - file offset. 259761847f8eSopenharmony_ci * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. 259861847f8eSopenharmony_ci * @returns { number } Returns the file offset relative to starting position of file. 259961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 260061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 260161847f8eSopenharmony_ci * @throws { BusinessError } 13900026 - Illegal seek 260261847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 260361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 260461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 260561847f8eSopenharmony_ci * @crossplatform 260661847f8eSopenharmony_ci * @since 12 260761847f8eSopenharmony_ci */ 260861847f8eSopenharmony_cideclare function lseek(fd: number, offset: number, whence?: WhenceType): number; 260961847f8eSopenharmony_ci 261061847f8eSopenharmony_ci/** 261161847f8eSopenharmony_ci * Stat link file. 261261847f8eSopenharmony_ci * 261361847f8eSopenharmony_ci * @param { string } path - path. 261461847f8eSopenharmony_ci * @returns { Promise<Stat> } Returns the Stat object in promise mode. 261561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 261661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 261761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 261861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 261961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 262061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 262161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 262261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 262361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 262461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 262561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 262661847f8eSopenharmony_ci * @since 9 262761847f8eSopenharmony_ci */ 262861847f8eSopenharmony_cideclare function lstat(path: string): Promise<Stat>; 262961847f8eSopenharmony_ci 263061847f8eSopenharmony_ci/** 263161847f8eSopenharmony_ci * Stat link file. 263261847f8eSopenharmony_ci * 263361847f8eSopenharmony_ci * @param { string } path - path. 263461847f8eSopenharmony_ci * @param { AsyncCallback<Stat> } callback - The callback is used to return the Stat object. 263561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 263661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 263761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 263861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 263961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 264061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 264161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 264261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 264361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 264461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 264561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 264661847f8eSopenharmony_ci * @since 9 264761847f8eSopenharmony_ci */ 264861847f8eSopenharmony_cideclare function lstat(path: string, callback: AsyncCallback<Stat>): void; 264961847f8eSopenharmony_ci 265061847f8eSopenharmony_ci/** 265161847f8eSopenharmony_ci * Stat link file with sync interface. 265261847f8eSopenharmony_ci * 265361847f8eSopenharmony_ci * @param { string } path - path. 265461847f8eSopenharmony_ci * @returns { Stat } Returns the Stat object. 265561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 265661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 265761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 265861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 265961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 266061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 266161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 266261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 266361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 266461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 266561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 266661847f8eSopenharmony_ci * @since 9 266761847f8eSopenharmony_ci */ 266861847f8eSopenharmony_cideclare function lstatSync(path: string): Stat; 266961847f8eSopenharmony_ci 267061847f8eSopenharmony_ci/** 267161847f8eSopenharmony_ci * Make dir. 267261847f8eSopenharmony_ci * 267361847f8eSopenharmony_ci * @param { string } path - path. 267461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 267561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 267661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 267761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 267861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 267961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 268061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 268161847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 268261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 268361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 268461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 268561847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 268661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 268761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 268861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 268961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 269061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 269161847f8eSopenharmony_ci * @since 9 269261847f8eSopenharmony_ci */ 269361847f8eSopenharmony_ci/** 269461847f8eSopenharmony_ci * Make dir. 269561847f8eSopenharmony_ci * 269661847f8eSopenharmony_ci * @param { string } path - path. 269761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 269861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 269961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 270061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 270161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 270261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 270361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 270461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 270561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 270661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 270761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 270861847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 270961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 271061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 271161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 271261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 271361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 271461847f8eSopenharmony_ci * @crossplatform 271561847f8eSopenharmony_ci * @since 10 271661847f8eSopenharmony_ci */ 271761847f8eSopenharmony_ci/** 271861847f8eSopenharmony_ci * Make dir. 271961847f8eSopenharmony_ci * 272061847f8eSopenharmony_ci * @param { string } path - path. 272161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 272261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 272361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 272461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 272561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 272661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 272761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 272861847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 272961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 273061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 273161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 273261847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 273361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 273461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 273561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 273661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 273761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 273861847f8eSopenharmony_ci * @crossplatform 273961847f8eSopenharmony_ci * @atomicservice 274061847f8eSopenharmony_ci * @since 11 274161847f8eSopenharmony_ci */ 274261847f8eSopenharmony_cideclare function mkdir(path: string): Promise<void>; 274361847f8eSopenharmony_ci 274461847f8eSopenharmony_ci/** 274561847f8eSopenharmony_ci * Make dir. 274661847f8eSopenharmony_ci * 274761847f8eSopenharmony_ci * @param { string } path - path. 274861847f8eSopenharmony_ci * @param { boolean } recursion - whether to recursively make directory. 274961847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 275061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 275161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 275261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 275361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 275461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 275561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 275661847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 275761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 275861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 275961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 276061847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 276161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 276261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 276361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 276461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 276561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 276661847f8eSopenharmony_ci * @atomicservice 276761847f8eSopenharmony_ci * @since 11 276861847f8eSopenharmony_ci */ 276961847f8eSopenharmony_cideclare function mkdir(path: string, recursion: boolean): Promise<void>; 277061847f8eSopenharmony_ci 277161847f8eSopenharmony_ci/** 277261847f8eSopenharmony_ci * Make dir. 277361847f8eSopenharmony_ci * 277461847f8eSopenharmony_ci * @param { string } path - path. 277561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 277661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 277761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 277861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 277961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 278061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 278161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 278261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 278361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 278461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 278561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 278661847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 278761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 278861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 278961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 279061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 279161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 279261847f8eSopenharmony_ci * @since 9 279361847f8eSopenharmony_ci */ 279461847f8eSopenharmony_ci/** 279561847f8eSopenharmony_ci * Make dir. 279661847f8eSopenharmony_ci * 279761847f8eSopenharmony_ci * @param { string } path - path. 279861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 279961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 280061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 280161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 280261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 280361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 280461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 280561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 280661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 280761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 280861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 280961847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 281061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 281161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 281261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 281361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 281461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 281561847f8eSopenharmony_ci * @crossplatform 281661847f8eSopenharmony_ci * @since 10 281761847f8eSopenharmony_ci */ 281861847f8eSopenharmony_ci/** 281961847f8eSopenharmony_ci * Make dir. 282061847f8eSopenharmony_ci * 282161847f8eSopenharmony_ci * @param { string } path - path. 282261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 282361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 282461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 282561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 282661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 282761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 282861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 282961847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 283061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 283161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 283261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 283361847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 283461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 283561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 283661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 283761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 283861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 283961847f8eSopenharmony_ci * @crossplatform 284061847f8eSopenharmony_ci * @atomicservice 284161847f8eSopenharmony_ci * @since 11 284261847f8eSopenharmony_ci */ 284361847f8eSopenharmony_cideclare function mkdir(path: string, callback: AsyncCallback<void>): void; 284461847f8eSopenharmony_ci 284561847f8eSopenharmony_ci/** 284661847f8eSopenharmony_ci * Make dir. 284761847f8eSopenharmony_ci * 284861847f8eSopenharmony_ci * @param { string } path - path. 284961847f8eSopenharmony_ci * @param { boolean } recursion - whether to recursively make directory. 285061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 285161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 285261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 285361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 285461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 285561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 285661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 285761847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 285861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 285961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 286061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 286161847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 286261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 286361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 286461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 286561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 286661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 286761847f8eSopenharmony_ci * @atomicservice 286861847f8eSopenharmony_ci * @since 11 286961847f8eSopenharmony_ci */ 287061847f8eSopenharmony_cideclare function mkdir(path: string, recursion: boolean, callback: AsyncCallback<void>): void; 287161847f8eSopenharmony_ci 287261847f8eSopenharmony_ci/** 287361847f8eSopenharmony_ci * Make dir with sync interface. 287461847f8eSopenharmony_ci * 287561847f8eSopenharmony_ci * @param { string } path - path. 287661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 287761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 287861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 287961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 288061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 288161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 288261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 288361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 288461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 288561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 288661847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 288761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 288861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 288961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 289061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 289161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 289261847f8eSopenharmony_ci * @since 9 289361847f8eSopenharmony_ci */ 289461847f8eSopenharmony_ci/** 289561847f8eSopenharmony_ci * Make dir with sync interface. 289661847f8eSopenharmony_ci * 289761847f8eSopenharmony_ci * @param { string } path - path. 289861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 289961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 290061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 290161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 290261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 290361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 290461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 290561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 290661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 290761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 290861847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 290961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 291061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 291161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 291261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 291361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 291461847f8eSopenharmony_ci * @crossplatform 291561847f8eSopenharmony_ci * @since 10 291661847f8eSopenharmony_ci */ 291761847f8eSopenharmony_ci/** 291861847f8eSopenharmony_ci * Make dir with sync interface. 291961847f8eSopenharmony_ci * 292061847f8eSopenharmony_ci * @param { string } path - path. 292161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 292261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 292361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 292461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 292561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 292661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 292761847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 292861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 292961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 293061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 293161847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 293261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 293361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 293461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 293561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 293661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 293761847f8eSopenharmony_ci * @crossplatform 293861847f8eSopenharmony_ci * @atomicservice 293961847f8eSopenharmony_ci * @since 11 294061847f8eSopenharmony_ci */ 294161847f8eSopenharmony_cideclare function mkdirSync(path: string): void; 294261847f8eSopenharmony_ci 294361847f8eSopenharmony_ci/** 294461847f8eSopenharmony_ci * Make dir with sync interface. 294561847f8eSopenharmony_ci * 294661847f8eSopenharmony_ci * @param { string } path - path. 294761847f8eSopenharmony_ci * @param { boolean } recursion - whether to recursively make directory. 294861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 294961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 295061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 295161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 295261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 295361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 295461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 295561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 295661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 295761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 295861847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 295961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 296061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 296161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 296261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 296361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 296461847f8eSopenharmony_ci * @atomicservice 296561847f8eSopenharmony_ci * @since 11 296661847f8eSopenharmony_ci */ 296761847f8eSopenharmony_cideclare function mkdirSync(path: string, recursion: boolean): void; 296861847f8eSopenharmony_ci 296961847f8eSopenharmony_ci/** 297061847f8eSopenharmony_ci * Make temp dir. 297161847f8eSopenharmony_ci * 297261847f8eSopenharmony_ci * @param { string } prefix - dir prefix. 297361847f8eSopenharmony_ci * @returns { Promise<string> } Returns the path to the new directory in promise mode. 297461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 297561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 297661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 297761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 297861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 297961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 298061847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 298161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 298261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 298361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 298461847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 298561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 298661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 298761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 298861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 298961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 299061847f8eSopenharmony_ci * @since 9 299161847f8eSopenharmony_ci */ 299261847f8eSopenharmony_ci/** 299361847f8eSopenharmony_ci * Make temp dir. 299461847f8eSopenharmony_ci * 299561847f8eSopenharmony_ci * @param { string } prefix - dir prefix. 299661847f8eSopenharmony_ci * @returns { Promise<string> } Returns the path to the new directory in promise mode. 299761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 299861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 299961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 300061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 300161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 300261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 300361847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 300461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 300561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 300661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 300761847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 300861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 300961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 301061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 301161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 301261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 301361847f8eSopenharmony_ci * @crossplatform 301461847f8eSopenharmony_ci * @since 10 301561847f8eSopenharmony_ci */ 301661847f8eSopenharmony_cideclare function mkdtemp(prefix: string): Promise<string>; 301761847f8eSopenharmony_ci 301861847f8eSopenharmony_ci/** 301961847f8eSopenharmony_ci * Make temp dir. 302061847f8eSopenharmony_ci * 302161847f8eSopenharmony_ci * @param { string } prefix - dir prefix. 302261847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the path to the new directory. 302361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 302461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 302561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 302661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 302761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 302861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 302961847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 303061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 303161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 303261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 303361847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 303461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 303561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 303661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 303761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 303861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 303961847f8eSopenharmony_ci * @since 9 304061847f8eSopenharmony_ci */ 304161847f8eSopenharmony_ci/** 304261847f8eSopenharmony_ci * Make temp dir. 304361847f8eSopenharmony_ci * 304461847f8eSopenharmony_ci * @param { string } prefix - dir prefix. 304561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the path to the new directory. 304661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 304761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 304861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 304961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 305061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 305161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 305261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 305361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 305461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 305561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 305661847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 305761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 305861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 305961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 306061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 306161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 306261847f8eSopenharmony_ci * @crossplatform 306361847f8eSopenharmony_ci * @since 10 306461847f8eSopenharmony_ci */ 306561847f8eSopenharmony_cideclare function mkdtemp(prefix: string, callback: AsyncCallback<string>): void; 306661847f8eSopenharmony_ci 306761847f8eSopenharmony_ci/** 306861847f8eSopenharmony_ci * Make temp dir with sync interface. 306961847f8eSopenharmony_ci * 307061847f8eSopenharmony_ci * @param { string } prefix - dir prefix. 307161847f8eSopenharmony_ci * @returns { string } Returns the path to the new directory. 307261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 307361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 307461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 307561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 307661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 307761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 307861847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 307961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 308061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 308161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 308261847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 308361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 308461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 308561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 308661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 308761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 308861847f8eSopenharmony_ci * @since 9 308961847f8eSopenharmony_ci */ 309061847f8eSopenharmony_ci/** 309161847f8eSopenharmony_ci * Make temp dir with sync interface. 309261847f8eSopenharmony_ci * 309361847f8eSopenharmony_ci * @param { string } prefix - dir prefix. 309461847f8eSopenharmony_ci * @returns { string } Returns the path to the new directory. 309561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 309661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 309761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 309861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 309961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 310061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 310161847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 310261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 310361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 310461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 310561847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 310661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 310761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 310861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 310961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 311061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 311161847f8eSopenharmony_ci * @crossplatform 311261847f8eSopenharmony_ci * @since 10 311361847f8eSopenharmony_ci */ 311461847f8eSopenharmony_cideclare function mkdtempSync(prefix: string): string; 311561847f8eSopenharmony_ci 311661847f8eSopenharmony_ci/** 311761847f8eSopenharmony_ci * Move directory. 311861847f8eSopenharmony_ci * 311961847f8eSopenharmony_ci * @param { string } src - source file path. 312061847f8eSopenharmony_ci * @param { string } dest - destination file path. 312161847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 312261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 312361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 312461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 312561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 312661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 312761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 312861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 312961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 313061847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 313161847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 313261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 313361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 313461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 313561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 313661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 313761847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 313861847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 313961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 314061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 314161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 314261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 314361847f8eSopenharmony_ci * @since 10 314461847f8eSopenharmony_ci */ 314561847f8eSopenharmony_cideclare function moveDir(src: string, dest: string, mode?: number): Promise<void>; 314661847f8eSopenharmony_ci 314761847f8eSopenharmony_ci/** 314861847f8eSopenharmony_ci * Move directory. 314961847f8eSopenharmony_ci * 315061847f8eSopenharmony_ci * @param { string } src - source file path. 315161847f8eSopenharmony_ci * @param { string } dest - destination file path. 315261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 315361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 315461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 315561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 315661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 315761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 315861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 315961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 316061847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 316161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 316261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 316361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 316461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 316561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 316661847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 316761847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 316861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 316961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 317061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 317161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 317261847f8eSopenharmony_ci * @since 10 317361847f8eSopenharmony_ci */ 317461847f8eSopenharmony_cideclare function moveDir(src: string, dest: string, callback: AsyncCallback<void>): void; 317561847f8eSopenharmony_ci 317661847f8eSopenharmony_ci/** 317761847f8eSopenharmony_ci * Move directory. 317861847f8eSopenharmony_ci * 317961847f8eSopenharmony_ci * @param { string } src - source file path. 318061847f8eSopenharmony_ci * @param { string } dest - destination file path. 318161847f8eSopenharmony_ci * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Return the callback function. 318261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 318361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 318461847f8eSopenharmony_ci * @since 10 318561847f8eSopenharmony_ci */ 318661847f8eSopenharmony_cideclare function moveDir(src: string, dest: string, callback: AsyncCallback<void, Array<ConflictFiles>>): void; 318761847f8eSopenharmony_ci 318861847f8eSopenharmony_ci/** 318961847f8eSopenharmony_ci * Move directory. 319061847f8eSopenharmony_ci * 319161847f8eSopenharmony_ci * @param { string } src - source file path. 319261847f8eSopenharmony_ci * @param { string } dest - destination file path. 319361847f8eSopenharmony_ci * @param { number } mode - move mode when duplicate file name exists. 319461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 319561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 319661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 319761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 319861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 319961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 320061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 320161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 320261847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 320361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 320461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 320561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 320661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 320761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 320861847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 320961847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 321061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 321161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 321261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 321361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 321461847f8eSopenharmony_ci * @since 10 321561847f8eSopenharmony_ci */ 321661847f8eSopenharmony_cideclare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback<void>): void; 321761847f8eSopenharmony_ci 321861847f8eSopenharmony_ci/** 321961847f8eSopenharmony_ci * Move directory. 322061847f8eSopenharmony_ci * 322161847f8eSopenharmony_ci * @param { string } src - source file path. 322261847f8eSopenharmony_ci * @param { string } dest - destination file path. 322361847f8eSopenharmony_ci * @param { number } mode - move mode when duplicate file name exists. 322461847f8eSopenharmony_ci * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Return the callback function. 322561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 322661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 322761847f8eSopenharmony_ci * @since 10 322861847f8eSopenharmony_ci */ 322961847f8eSopenharmony_cideclare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback<void, Array<ConflictFiles>>): void; 323061847f8eSopenharmony_ci 323161847f8eSopenharmony_ci/** 323261847f8eSopenharmony_ci * Move directory with sync interface. 323361847f8eSopenharmony_ci * 323461847f8eSopenharmony_ci * @param { string } src - source file path. 323561847f8eSopenharmony_ci * @param { string } dest - destination file path. 323661847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 323761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 323861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 323961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 324061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 324161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 324261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 324361847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 324461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 324561847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 324661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 324761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 324861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 324961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 325061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 325161847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 325261847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 325361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 325461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 325561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 325661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 325761847f8eSopenharmony_ci * @since 10 325861847f8eSopenharmony_ci */ 325961847f8eSopenharmony_cideclare function moveDirSync(src: string, dest: string, mode?: number): void; 326061847f8eSopenharmony_ci 326161847f8eSopenharmony_ci/** 326261847f8eSopenharmony_ci * Move file. 326361847f8eSopenharmony_ci * 326461847f8eSopenharmony_ci * @param { string } src - source file path. 326561847f8eSopenharmony_ci * @param { string } dest - destination file path. 326661847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 326761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 326861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 326961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 327061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 327161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 327261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 327361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 327461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 327561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 327661847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 327761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 327861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 327961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 328061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 328161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 328261847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 328361847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 328461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 328561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 328661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 328761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 328861847f8eSopenharmony_ci * @since 9 328961847f8eSopenharmony_ci */ 329061847f8eSopenharmony_ci/** 329161847f8eSopenharmony_ci * Move file. 329261847f8eSopenharmony_ci * 329361847f8eSopenharmony_ci * @param { string } src - source file path. 329461847f8eSopenharmony_ci * @param { string } dest - destination file path. 329561847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 329661847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 329761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 329861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 329961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 330061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 330161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 330261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 330361847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 330461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 330561847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 330661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 330761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 330861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 330961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 331061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 331161847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 331261847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 331361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 331461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 331561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 331661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 331761847f8eSopenharmony_ci * @crossplatform 331861847f8eSopenharmony_ci * @since 10 331961847f8eSopenharmony_ci */ 332061847f8eSopenharmony_cideclare function moveFile(src: string, dest: string, mode?: number): Promise<void>; 332161847f8eSopenharmony_ci 332261847f8eSopenharmony_ci/** 332361847f8eSopenharmony_ci * Move file. 332461847f8eSopenharmony_ci * 332561847f8eSopenharmony_ci * @param { string } src - source file path. 332661847f8eSopenharmony_ci * @param { string } dest - destination file path. 332761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 332861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 332961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 333061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 333161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 333261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 333361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 333461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 333561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 333661847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 333761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 333861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 333961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 334061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 334161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 334261847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 334361847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 334461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 334561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 334661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 334761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 334861847f8eSopenharmony_ci * @since 9 334961847f8eSopenharmony_ci */ 335061847f8eSopenharmony_ci/** 335161847f8eSopenharmony_ci * Move file. 335261847f8eSopenharmony_ci * 335361847f8eSopenharmony_ci * @param { string } src - source file path. 335461847f8eSopenharmony_ci * @param { string } dest - destination file path. 335561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 335661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 335761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 335861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 335961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 336061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 336161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 336261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 336361847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 336461847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 336561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 336661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 336761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 336861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 336961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 337061847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 337161847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 337261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 337361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 337461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 337561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 337661847f8eSopenharmony_ci * @crossplatform 337761847f8eSopenharmony_ci * @since 10 337861847f8eSopenharmony_ci */ 337961847f8eSopenharmony_cideclare function moveFile(src: string, dest: string, callback: AsyncCallback<void>): void; 338061847f8eSopenharmony_ci 338161847f8eSopenharmony_ci/** 338261847f8eSopenharmony_ci * Move file. 338361847f8eSopenharmony_ci * 338461847f8eSopenharmony_ci * @param { string } src - source file path. 338561847f8eSopenharmony_ci * @param { string } dest - destination file path. 338661847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 338761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 338861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 338961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 339061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 339161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 339261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 339361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 339461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 339561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 339661847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 339761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 339861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 339961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 340061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 340161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 340261847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 340361847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 340461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 340561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 340661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 340761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 340861847f8eSopenharmony_ci * @since 9 340961847f8eSopenharmony_ci */ 341061847f8eSopenharmony_ci/** 341161847f8eSopenharmony_ci * Move file. 341261847f8eSopenharmony_ci * 341361847f8eSopenharmony_ci * @param { string } src - source file path. 341461847f8eSopenharmony_ci * @param { string } dest - destination file path. 341561847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 341661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 341761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 341861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 341961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 342061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 342161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 342261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 342361847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 342461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 342561847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 342661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 342761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 342861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 342961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 343061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 343161847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 343261847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 343361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 343461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 343561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 343661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 343761847f8eSopenharmony_ci * @crossplatform 343861847f8eSopenharmony_ci * @since 10 343961847f8eSopenharmony_ci */ 344061847f8eSopenharmony_cideclare function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback<void>): void; 344161847f8eSopenharmony_ci 344261847f8eSopenharmony_ci/** 344361847f8eSopenharmony_ci * Move file with sync interface. 344461847f8eSopenharmony_ci * 344561847f8eSopenharmony_ci * @param { string } src - source file path. 344661847f8eSopenharmony_ci * @param { string } dest - destination file path. 344761847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 344861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 344961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 345061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 345161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 345261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 345361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 345461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 345561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 345661847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 345761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 345861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 345961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 346061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 346161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 346261847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 346361847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 346461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 346561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 346661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 346761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 346861847f8eSopenharmony_ci * @since 9 346961847f8eSopenharmony_ci */ 347061847f8eSopenharmony_ci/** 347161847f8eSopenharmony_ci * Move file with sync interface. 347261847f8eSopenharmony_ci * 347361847f8eSopenharmony_ci * @param { string } src - source file path. 347461847f8eSopenharmony_ci * @param { string } dest - destination file path. 347561847f8eSopenharmony_ci * @param { number } [mode = 0] - move mode when duplicate file name exists. 347661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 347761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 347861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 347961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 348061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 348161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 348261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 348361847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 348461847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 348561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 348661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 348761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 348861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 348961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 349061847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 349161847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 349261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 349361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 349461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 349561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 349661847f8eSopenharmony_ci * @crossplatform 349761847f8eSopenharmony_ci * @since 10 349861847f8eSopenharmony_ci */ 349961847f8eSopenharmony_cideclare function moveFileSync(src: string, dest: string, mode?: number): void; 350061847f8eSopenharmony_ci 350161847f8eSopenharmony_ci/** 350261847f8eSopenharmony_ci * Open file. 350361847f8eSopenharmony_ci * 350461847f8eSopenharmony_ci * @param { string } path - path. 350561847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 350661847f8eSopenharmony_ci * @returns { Promise<File> } Returns the File object in Promise mode to record the file descriptor. 350761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 350861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 350961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 351061847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 351161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 351261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 351361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 351461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 351561847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 351661847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 351761847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 351861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 351961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 352061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 352161847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 352261847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 352361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 352461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 352561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 352661847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 352761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 352861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 352961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 353061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 353161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 353261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 353361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 353461847f8eSopenharmony_ci * @since 9 353561847f8eSopenharmony_ci */ 353661847f8eSopenharmony_ci/** 353761847f8eSopenharmony_ci * Open file. 353861847f8eSopenharmony_ci * 353961847f8eSopenharmony_ci * @param { string } path - path. 354061847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 354161847f8eSopenharmony_ci * @returns { Promise<File> } Returns the File object in Promise mode to record the file descriptor. 354261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 354361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 354461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 354561847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 354661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 354761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 354861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 354961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 355061847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 355161847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 355261847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 355361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 355461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 355561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 355661847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 355761847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 355861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 355961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 356061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 356161847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 356261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 356361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 356461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 356561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 356661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 356761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 356861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 356961847f8eSopenharmony_ci * @crossplatform 357061847f8eSopenharmony_ci * @since 10 357161847f8eSopenharmony_ci */ 357261847f8eSopenharmony_ci/** 357361847f8eSopenharmony_ci * Open file. 357461847f8eSopenharmony_ci * 357561847f8eSopenharmony_ci * @param { string } path - path. 357661847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 357761847f8eSopenharmony_ci * @returns { Promise<File> } Returns the File object in Promise mode to record the file descriptor. 357861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 357961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 358061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 358161847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 358261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 358361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 358461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 358561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 358661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 358761847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 358861847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 358961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 359061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 359161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 359261847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 359361847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 359461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 359561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 359661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 359761847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 359861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 359961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 360061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 360161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 360261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 360361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 360461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 360561847f8eSopenharmony_ci * @crossplatform 360661847f8eSopenharmony_ci * @atomicservice 360761847f8eSopenharmony_ci * @since 11 360861847f8eSopenharmony_ci */ 360961847f8eSopenharmony_ci/** 361061847f8eSopenharmony_ci * Open file. 361161847f8eSopenharmony_ci * 361261847f8eSopenharmony_ci * @param { string } path - path. 361361847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 361461847f8eSopenharmony_ci * @returns { Promise<File> } Returns the File object in Promise mode to record the file descriptor. 361561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 361661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 361761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 361861847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 361961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 362061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 362161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 362261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 362361847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 362461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 362561847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 362661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 362761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 362861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 362961847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 363061847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 363161847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 363261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 363361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 363461847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 363561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 363661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 363761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 363861847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 363961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 364061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 364161847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 364261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 364361847f8eSopenharmony_ci * @crossplatform 364461847f8eSopenharmony_ci * @atomicservice 364561847f8eSopenharmony_ci * @since 12 364661847f8eSopenharmony_ci */ 364761847f8eSopenharmony_cideclare function open(path: string, mode?: number): Promise<File>; 364861847f8eSopenharmony_ci 364961847f8eSopenharmony_ci/** 365061847f8eSopenharmony_ci * Open file. 365161847f8eSopenharmony_ci * 365261847f8eSopenharmony_ci * @param { string } path - path. 365361847f8eSopenharmony_ci * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor. 365461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 365561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 365661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 365761847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 365861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 365961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 366061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 366161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 366261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 366361847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 366461847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 366561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 366661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 366761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 366861847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 366961847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 367061847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 367161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 367261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 367361847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 367461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 367561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 367661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 367761847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 367861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 367961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 368061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 368161847f8eSopenharmony_ci * @since 9 368261847f8eSopenharmony_ci */ 368361847f8eSopenharmony_ci/** 368461847f8eSopenharmony_ci * Open file. 368561847f8eSopenharmony_ci * 368661847f8eSopenharmony_ci * @param { string } path - path. 368761847f8eSopenharmony_ci * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor. 368861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 368961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 369061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 369161847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 369261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 369361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 369461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 369561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 369661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 369761847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 369861847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 369961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 370061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 370161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 370261847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 370361847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 370461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 370561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 370661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 370761847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 370861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 370961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 371061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 371161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 371261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 371361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 371461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 371561847f8eSopenharmony_ci * @crossplatform 371661847f8eSopenharmony_ci * @since 10 371761847f8eSopenharmony_ci */ 371861847f8eSopenharmony_ci/** 371961847f8eSopenharmony_ci * Open file. 372061847f8eSopenharmony_ci * 372161847f8eSopenharmony_ci * @param { string } path - path. 372261847f8eSopenharmony_ci * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor. 372361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 372461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 372561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 372661847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 372761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 372861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 372961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 373061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 373161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 373261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 373361847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 373461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 373561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 373661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 373761847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 373861847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 373961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 374061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 374161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 374261847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 374361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 374461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 374561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 374661847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 374761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 374861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 374961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 375061847f8eSopenharmony_ci * @crossplatform 375161847f8eSopenharmony_ci * @atomicservice 375261847f8eSopenharmony_ci * @since 11 375361847f8eSopenharmony_ci */ 375461847f8eSopenharmony_cideclare function open(path: string, callback: AsyncCallback<File>): void; 375561847f8eSopenharmony_ci 375661847f8eSopenharmony_ci/** 375761847f8eSopenharmony_ci * Open file. 375861847f8eSopenharmony_ci * 375961847f8eSopenharmony_ci * @param { string } path - path. 376061847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 376161847f8eSopenharmony_ci * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor. 376261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 376361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 376461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 376561847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 376661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 376761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 376861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 376961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 377061847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 377161847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 377261847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 377361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 377461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 377561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 377661847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 377761847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 377861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 377961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 378061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 378161847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 378261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 378361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 378461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 378561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 378661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 378761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 378861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 378961847f8eSopenharmony_ci * @since 9 379061847f8eSopenharmony_ci */ 379161847f8eSopenharmony_ci/** 379261847f8eSopenharmony_ci * Open file. 379361847f8eSopenharmony_ci * 379461847f8eSopenharmony_ci * @param { string } path - path. 379561847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 379661847f8eSopenharmony_ci * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor. 379761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 379861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 379961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 380061847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 380161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 380261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 380361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 380461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 380561847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 380661847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 380761847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 380861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 380961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 381061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 381161847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 381261847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 381361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 381461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 381561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 381661847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 381761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 381861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 381961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 382061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 382161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 382261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 382361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 382461847f8eSopenharmony_ci * @crossplatform 382561847f8eSopenharmony_ci * @since 10 382661847f8eSopenharmony_ci */ 382761847f8eSopenharmony_ci/** 382861847f8eSopenharmony_ci * Open file. 382961847f8eSopenharmony_ci * 383061847f8eSopenharmony_ci * @param { string } path - path. 383161847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 383261847f8eSopenharmony_ci * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor. 383361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 383461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 383561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 383661847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 383761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 383861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 383961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 384061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 384161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 384261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 384361847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 384461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 384561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 384661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 384761847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 384861847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 384961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 385061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 385161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 385261847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 385361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 385461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 385561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 385661847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 385761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 385861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 385961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 386061847f8eSopenharmony_ci * @crossplatform 386161847f8eSopenharmony_ci * @atomicservice 386261847f8eSopenharmony_ci * @since 11 386361847f8eSopenharmony_ci */ 386461847f8eSopenharmony_cideclare function open(path: string, mode: number, callback: AsyncCallback<File>): void; 386561847f8eSopenharmony_ci 386661847f8eSopenharmony_ci/** 386761847f8eSopenharmony_ci * Open file with sync interface. 386861847f8eSopenharmony_ci * 386961847f8eSopenharmony_ci * @param { string } path - path. 387061847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 387161847f8eSopenharmony_ci * @returns { File } Returns the File object to record the file descriptor. 387261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 387361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 387461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 387561847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 387661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 387761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 387861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 387961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 388061847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 388161847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 388261847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 388361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 388461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 388561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 388661847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 388761847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 388861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 388961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 389061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 389161847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 389261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 389361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 389461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 389561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 389661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 389761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 389861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 389961847f8eSopenharmony_ci * @since 9 390061847f8eSopenharmony_ci */ 390161847f8eSopenharmony_ci/** 390261847f8eSopenharmony_ci * Open file with sync interface. 390361847f8eSopenharmony_ci * 390461847f8eSopenharmony_ci * @param { string } path - path. 390561847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 390661847f8eSopenharmony_ci * @returns { File } Returns the File object to record the file descriptor. 390761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 390861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 390961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 391061847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 391161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 391261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 391361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 391461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 391561847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 391661847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 391761847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 391861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 391961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 392061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 392161847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 392261847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 392361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 392461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 392561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 392661847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 392761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 392861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 392961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 393061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 393161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 393261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 393361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 393461847f8eSopenharmony_ci * @crossplatform 393561847f8eSopenharmony_ci * @since 10 393661847f8eSopenharmony_ci */ 393761847f8eSopenharmony_ci/** 393861847f8eSopenharmony_ci * Open file with sync interface. 393961847f8eSopenharmony_ci * 394061847f8eSopenharmony_ci * @param { string } path - path. 394161847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 394261847f8eSopenharmony_ci * @returns { File } Returns the File object to record the file descriptor. 394361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 394461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 394561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 394661847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 394761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 394861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 394961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 395061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 395161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 395261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 395361847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 395461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 395561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 395661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 395761847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 395861847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 395961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 396061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 396161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 396261847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 396361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 396461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 396561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 396661847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 396761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 396861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 396961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 397061847f8eSopenharmony_ci * @crossplatform 397161847f8eSopenharmony_ci * @atomicservice 397261847f8eSopenharmony_ci * @since 11 397361847f8eSopenharmony_ci */ 397461847f8eSopenharmony_ci/** 397561847f8eSopenharmony_ci * Open file with sync interface. 397661847f8eSopenharmony_ci * 397761847f8eSopenharmony_ci * @param { string } path - path. 397861847f8eSopenharmony_ci * @param { number } [mode = OpenMode.READ_ONLY] - mode. 397961847f8eSopenharmony_ci * @returns { File } Returns the File object to record the file descriptor. 398061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 398161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 398261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 398361847f8eSopenharmony_ci * @throws { BusinessError } 13900006 - No such device or address 398461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 398561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 398661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 398761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 398861847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 398961847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 399061847f8eSopenharmony_ci * @throws { BusinessError } 13900017 - No such device 399161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 399261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 399361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 399461847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 399561847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 399661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 399761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 399861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 399961847f8eSopenharmony_ci * @throws { BusinessError } 13900029 - Resource deadlock would occur 400061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 400161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 400261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 400361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 400461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 400561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 400661847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 400761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 400861847f8eSopenharmony_ci * @crossplatform 400961847f8eSopenharmony_ci * @atomicservice 401061847f8eSopenharmony_ci * @since 12 401161847f8eSopenharmony_ci */ 401261847f8eSopenharmony_cideclare function openSync(path: string, mode?: number): File; 401361847f8eSopenharmony_ci 401461847f8eSopenharmony_ci/** 401561847f8eSopenharmony_ci * Read file. 401661847f8eSopenharmony_ci * 401761847f8eSopenharmony_ci * @param { number } fd - file descriptor. 401861847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 401961847f8eSopenharmony_ci * @param { object } [options] - options. 402061847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 402161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 402261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 402361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 402461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 402561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 402661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 402761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 402861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 402961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 403061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 403161847f8eSopenharmony_ci * @since 9 403261847f8eSopenharmony_ci */ 403361847f8eSopenharmony_ci/** 403461847f8eSopenharmony_ci * Read file. 403561847f8eSopenharmony_ci * 403661847f8eSopenharmony_ci * @param { number } fd - file descriptor. 403761847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 403861847f8eSopenharmony_ci * @param { object } [options] - options. 403961847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 404061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 404161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 404261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 404361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 404461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 404561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 404661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 404761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 404861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 404961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 405061847f8eSopenharmony_ci * @crossplatform 405161847f8eSopenharmony_ci * @since 10 405261847f8eSopenharmony_ci */ 405361847f8eSopenharmony_ci/** 405461847f8eSopenharmony_ci * Read file. 405561847f8eSopenharmony_ci * 405661847f8eSopenharmony_ci * @param { number } fd - file descriptor. 405761847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 405861847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 405961847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 406061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 406161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 406261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 406361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 406461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 406561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 406661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 406761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 406861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 406961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 407061847f8eSopenharmony_ci * @crossplatform 407161847f8eSopenharmony_ci * @atomicservice 407261847f8eSopenharmony_ci * @since 11 407361847f8eSopenharmony_ci */ 407461847f8eSopenharmony_ci/** 407561847f8eSopenharmony_ci * Read file. 407661847f8eSopenharmony_ci * 407761847f8eSopenharmony_ci * @param { number } fd - file descriptor. 407861847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 407961847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 408061847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 408161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 408261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 408361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 408461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 408561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 408661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 408761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 408861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 408961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 409061847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 409161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 409261847f8eSopenharmony_ci * @crossplatform 409361847f8eSopenharmony_ci * @atomicservice 409461847f8eSopenharmony_ci * @since 12 409561847f8eSopenharmony_ci */ 409661847f8eSopenharmony_cideclare function read( 409761847f8eSopenharmony_ci fd: number, 409861847f8eSopenharmony_ci buffer: ArrayBuffer, 409961847f8eSopenharmony_ci options?: ReadOptions 410061847f8eSopenharmony_ci): Promise<number>; 410161847f8eSopenharmony_ci 410261847f8eSopenharmony_ci/** 410361847f8eSopenharmony_ci * Read file. 410461847f8eSopenharmony_ci * 410561847f8eSopenharmony_ci * @param { number } fd - file descriptor. 410661847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 410761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 410861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 410961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 411061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 411161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 411261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 411361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 411461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 411561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 411661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 411761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 411861847f8eSopenharmony_ci * @since 9 411961847f8eSopenharmony_ci */ 412061847f8eSopenharmony_ci/** 412161847f8eSopenharmony_ci * Read file. 412261847f8eSopenharmony_ci * 412361847f8eSopenharmony_ci * @param { number } fd - file descriptor. 412461847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 412561847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 412661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 412761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 412861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 412961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 413061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 413161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 413261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 413361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 413461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 413561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 413661847f8eSopenharmony_ci * @crossplatform 413761847f8eSopenharmony_ci * @since 10 413861847f8eSopenharmony_ci */ 413961847f8eSopenharmony_ci/** 414061847f8eSopenharmony_ci * Read file. 414161847f8eSopenharmony_ci * 414261847f8eSopenharmony_ci * @param { number } fd - file descriptor. 414361847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 414461847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 414561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 414661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 414761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 414861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 414961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 415061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 415161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 415261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 415361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 415461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 415561847f8eSopenharmony_ci * @crossplatform 415661847f8eSopenharmony_ci * @atomicservice 415761847f8eSopenharmony_ci * @since 11 415861847f8eSopenharmony_ci */ 415961847f8eSopenharmony_cideclare function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback<number>): void; 416061847f8eSopenharmony_ci 416161847f8eSopenharmony_ci/** 416261847f8eSopenharmony_ci * Read file. 416361847f8eSopenharmony_ci * 416461847f8eSopenharmony_ci * @param { number } fd - file descriptor. 416561847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 416661847f8eSopenharmony_ci * @param { object } [options] - options. 416761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 416861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 416961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 417061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 417161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 417261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 417361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 417461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 417561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 417661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 417761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 417861847f8eSopenharmony_ci * @since 9 417961847f8eSopenharmony_ci */ 418061847f8eSopenharmony_ci/** 418161847f8eSopenharmony_ci * Read file. 418261847f8eSopenharmony_ci * 418361847f8eSopenharmony_ci * @param { number } fd - file descriptor. 418461847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 418561847f8eSopenharmony_ci * @param { object } [options] - options. 418661847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 418761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 418861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 418961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 419061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 419161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 419261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 419361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 419461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 419561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 419661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 419761847f8eSopenharmony_ci * @crossplatform 419861847f8eSopenharmony_ci * @since 10 419961847f8eSopenharmony_ci */ 420061847f8eSopenharmony_ci/** 420161847f8eSopenharmony_ci * Read file. 420261847f8eSopenharmony_ci * 420361847f8eSopenharmony_ci * @param { number } fd - file descriptor. 420461847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 420561847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 420661847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 420761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 420861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 420961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 421061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 421161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 421261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 421361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 421461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 421561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 421661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 421761847f8eSopenharmony_ci * @crossplatform 421861847f8eSopenharmony_ci * @atomicservice 421961847f8eSopenharmony_ci * @since 11 422061847f8eSopenharmony_ci */ 422161847f8eSopenharmony_cideclare function read( 422261847f8eSopenharmony_ci fd: number, 422361847f8eSopenharmony_ci buffer: ArrayBuffer, 422461847f8eSopenharmony_ci options: ReadOptions, 422561847f8eSopenharmony_ci callback: AsyncCallback<number> 422661847f8eSopenharmony_ci): void; 422761847f8eSopenharmony_ci 422861847f8eSopenharmony_ci/** 422961847f8eSopenharmony_ci * Read file with sync interface. 423061847f8eSopenharmony_ci * 423161847f8eSopenharmony_ci * @param { number } fd - file descriptor. 423261847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 423361847f8eSopenharmony_ci * @param { object } [options] - options. 423461847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to buffer. 423561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 423661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 423761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 423861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 423961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 424061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 424161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 424261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 424361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 424461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 424561847f8eSopenharmony_ci * @since 9 424661847f8eSopenharmony_ci */ 424761847f8eSopenharmony_ci/** 424861847f8eSopenharmony_ci * Read file with sync interface. 424961847f8eSopenharmony_ci * 425061847f8eSopenharmony_ci * @param { number } fd - file descriptor. 425161847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 425261847f8eSopenharmony_ci * @param { object } [options] - options. 425361847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to buffer. 425461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 425561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 425661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 425761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 425861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 425961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 426061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 426161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 426261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 426361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 426461847f8eSopenharmony_ci * @crossplatform 426561847f8eSopenharmony_ci * @since 10 426661847f8eSopenharmony_ci */ 426761847f8eSopenharmony_ci/** 426861847f8eSopenharmony_ci * Read file with sync interface. 426961847f8eSopenharmony_ci * 427061847f8eSopenharmony_ci * @param { number } fd - file descriptor. 427161847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 427261847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 427361847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to buffer. 427461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 427561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 427661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 427761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 427861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 427961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 428061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 428161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 428261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 428361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 428461847f8eSopenharmony_ci * @crossplatform 428561847f8eSopenharmony_ci * @atomicservice 428661847f8eSopenharmony_ci * @since 11 428761847f8eSopenharmony_ci */ 428861847f8eSopenharmony_ci/** 428961847f8eSopenharmony_ci * Read file with sync interface. 429061847f8eSopenharmony_ci * 429161847f8eSopenharmony_ci * @param { number } fd - file descriptor. 429261847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 429361847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 429461847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to buffer. 429561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 429661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 429761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 429861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 429961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 430061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 430161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 430261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 430361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 430461847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 430561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 430661847f8eSopenharmony_ci * @crossplatform 430761847f8eSopenharmony_ci * @atomicservice 430861847f8eSopenharmony_ci * @since 12 430961847f8eSopenharmony_ci */ 431061847f8eSopenharmony_cideclare function readSync( 431161847f8eSopenharmony_ci fd: number, 431261847f8eSopenharmony_ci buffer: ArrayBuffer, 431361847f8eSopenharmony_ci options?: ReadOptions 431461847f8eSopenharmony_ci): number; 431561847f8eSopenharmony_ci 431661847f8eSopenharmony_ci/** 431761847f8eSopenharmony_ci * Read content line by line. 431861847f8eSopenharmony_ci * 431961847f8eSopenharmony_ci * @param { string } filePath - file path. 432061847f8eSopenharmony_ci * @param { Options } [options] - optional parameters 432161847f8eSopenharmony_ci * @returns { Promise<ReaderIterator> } Returns the iterator object in promise mode. 432261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 432361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 432461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 432561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 432661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 432761847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 432861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 432961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 433061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 433161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 433261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 433361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 433461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 433561847f8eSopenharmony_ci * @since 11 433661847f8eSopenharmony_ci */ 433761847f8eSopenharmony_ci/** 433861847f8eSopenharmony_ci * Read content line by line. 433961847f8eSopenharmony_ci * 434061847f8eSopenharmony_ci * @param { string } filePath - file path. 434161847f8eSopenharmony_ci * @param { Options } [options] - optional parameters 434261847f8eSopenharmony_ci * @returns { Promise<ReaderIterator> } Returns the iterator object in promise mode. 434361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 434461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 434561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 434661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 434761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 434861847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 434961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 435061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 435161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 435261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 435361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 435461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 435561847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 435661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 435761847f8eSopenharmony_ci * @since 12 435861847f8eSopenharmony_ci */ 435961847f8eSopenharmony_cideclare function readLines(filePath: string, options?: Options): Promise<ReaderIterator>; 436061847f8eSopenharmony_ci 436161847f8eSopenharmony_ci/** 436261847f8eSopenharmony_ci * Read content line by line. 436361847f8eSopenharmony_ci * 436461847f8eSopenharmony_ci * @param { string } filePath - file path. 436561847f8eSopenharmony_ci * @param { AsyncCallback<ReaderIterator> } callback - The callback is used to return the iterator object. 436661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 436761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 436861847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 436961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 437061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 437161847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 437261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 437361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 437461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 437561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 437661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 437761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 437861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 437961847f8eSopenharmony_ci * @since 11 438061847f8eSopenharmony_ci */ 438161847f8eSopenharmony_cideclare function readLines(filePath: string, callback: AsyncCallback<ReaderIterator>): void; 438261847f8eSopenharmony_ci 438361847f8eSopenharmony_ci/** 438461847f8eSopenharmony_ci * Read content line by line. 438561847f8eSopenharmony_ci * 438661847f8eSopenharmony_ci * @param { string } filePath - file path. 438761847f8eSopenharmony_ci * @param { Options } options - optional parameters 438861847f8eSopenharmony_ci * @param { AsyncCallback<ReaderIterator> } callback - The callback is used to return the iterator object. 438961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 439061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 439161847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 439261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 439361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 439461847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 439561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 439661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 439761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 439861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 439961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 440061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 440161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 440261847f8eSopenharmony_ci * @since 11 440361847f8eSopenharmony_ci */ 440461847f8eSopenharmony_cideclare function readLines(filePath: string, options: Options, callback: AsyncCallback<ReaderIterator>): void; 440561847f8eSopenharmony_ci 440661847f8eSopenharmony_ci/** 440761847f8eSopenharmony_ci * Read content line by line with sync interface. 440861847f8eSopenharmony_ci * 440961847f8eSopenharmony_ci * @param { string } filePath - file path. 441061847f8eSopenharmony_ci * @param { Options } [options] - optional parameters 441161847f8eSopenharmony_ci * @returns { ReaderIterator } Returns the iterator object. 441261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 441361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 441461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 441561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 441661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 441761847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 441861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 441961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 442061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 442161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 442261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 442361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 442461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 442561847f8eSopenharmony_ci * @since 11 442661847f8eSopenharmony_ci */ 442761847f8eSopenharmony_ci/** 442861847f8eSopenharmony_ci * Read content line by line with sync interface. 442961847f8eSopenharmony_ci * 443061847f8eSopenharmony_ci * @param { string } filePath - file path. 443161847f8eSopenharmony_ci * @param { Options } [options] - optional parameters 443261847f8eSopenharmony_ci * @returns { ReaderIterator } Returns the iterator object. 443361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 443461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 443561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 443661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 443761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 443861847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 443961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 444061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 444161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 444261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 444361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 444461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 444561847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 444661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 444761847f8eSopenharmony_ci * @since 12 444861847f8eSopenharmony_ci */ 444961847f8eSopenharmony_cideclare function readLinesSync(filePath: string, options?: Options): ReaderIterator; 445061847f8eSopenharmony_ci 445161847f8eSopenharmony_ci/** 445261847f8eSopenharmony_ci * Read text. 445361847f8eSopenharmony_ci * 445461847f8eSopenharmony_ci * @param { string } filePath - file path. 445561847f8eSopenharmony_ci * @param { object } [options] - options. 445661847f8eSopenharmony_ci * @returns { Promise<string> } Returns the contents of the read file in promise mode. 445761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 445861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 445961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 446061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 446161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 446261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 446361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 446461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 446561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 446661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 446761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 446861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 446961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 447061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 447161847f8eSopenharmony_ci * @since 9 447261847f8eSopenharmony_ci */ 447361847f8eSopenharmony_ci/** 447461847f8eSopenharmony_ci * Read text. 447561847f8eSopenharmony_ci * 447661847f8eSopenharmony_ci * @param { string } filePath - file path. 447761847f8eSopenharmony_ci * @param { object } [options] - options. 447861847f8eSopenharmony_ci * @returns { Promise<string> } Returns the contents of the read file in promise mode. 447961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 448061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 448161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 448261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 448361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 448461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 448561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 448661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 448761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 448861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 448961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 449061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 449161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 449261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 449361847f8eSopenharmony_ci * @crossplatform 449461847f8eSopenharmony_ci * @since 10 449561847f8eSopenharmony_ci */ 449661847f8eSopenharmony_ci/** 449761847f8eSopenharmony_ci * Read text. 449861847f8eSopenharmony_ci * 449961847f8eSopenharmony_ci * @param { string } filePath - file path. 450061847f8eSopenharmony_ci * @param { ReadTextOptions } [options] - options. 450161847f8eSopenharmony_ci * @returns { Promise<string> } Returns the contents of the read file in promise mode. 450261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 450361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 450461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 450561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 450661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 450761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 450861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 450961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 451061847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 451161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 451261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 451361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 451461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 451561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 451661847f8eSopenharmony_ci * @crossplatform 451761847f8eSopenharmony_ci * @atomicservice 451861847f8eSopenharmony_ci * @since 11 451961847f8eSopenharmony_ci */ 452061847f8eSopenharmony_ci/** 452161847f8eSopenharmony_ci * Read text. 452261847f8eSopenharmony_ci * 452361847f8eSopenharmony_ci * @param { string } filePath - file path. 452461847f8eSopenharmony_ci * @param { ReadTextOptions } [options] - options. 452561847f8eSopenharmony_ci * @returns { Promise<string> } Returns the contents of the read file in promise mode. 452661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 452761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 452861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 452961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 453061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 453161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 453261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 453361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 453461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 453561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 453661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 453761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 453861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 453961847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 454061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 454161847f8eSopenharmony_ci * @crossplatform 454261847f8eSopenharmony_ci * @atomicservice 454361847f8eSopenharmony_ci * @since 12 454461847f8eSopenharmony_ci */ 454561847f8eSopenharmony_cideclare function readText( 454661847f8eSopenharmony_ci filePath: string, 454761847f8eSopenharmony_ci options?: ReadTextOptions 454861847f8eSopenharmony_ci): Promise<string>; 454961847f8eSopenharmony_ci 455061847f8eSopenharmony_ci/** 455161847f8eSopenharmony_ci * Read text. 455261847f8eSopenharmony_ci * 455361847f8eSopenharmony_ci * @param { string } filePath - file path. 455461847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file. 455561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 455661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 455761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 455861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 455961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 456061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 456161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 456261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 456361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 456461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 456561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 456661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 456761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 456861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 456961847f8eSopenharmony_ci * @since 9 457061847f8eSopenharmony_ci */ 457161847f8eSopenharmony_ci/** 457261847f8eSopenharmony_ci * Read text. 457361847f8eSopenharmony_ci * 457461847f8eSopenharmony_ci * @param { string } filePath - file path. 457561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file. 457661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 457761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 457861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 457961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 458061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 458161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 458261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 458361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 458461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 458561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 458661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 458761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 458861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 458961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 459061847f8eSopenharmony_ci * @crossplatform 459161847f8eSopenharmony_ci * @since 10 459261847f8eSopenharmony_ci */ 459361847f8eSopenharmony_ci/** 459461847f8eSopenharmony_ci * Read text. 459561847f8eSopenharmony_ci * 459661847f8eSopenharmony_ci * @param { string } filePath - file path. 459761847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file. 459861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 459961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 460061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 460161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 460261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 460361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 460461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 460561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 460661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 460761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 460861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 460961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 461061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 461161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 461261847f8eSopenharmony_ci * @crossplatform 461361847f8eSopenharmony_ci * @atomicservice 461461847f8eSopenharmony_ci * @since 11 461561847f8eSopenharmony_ci */ 461661847f8eSopenharmony_cideclare function readText(filePath: string, callback: AsyncCallback<string>): void; 461761847f8eSopenharmony_ci 461861847f8eSopenharmony_ci/** 461961847f8eSopenharmony_ci * Read text. 462061847f8eSopenharmony_ci * 462161847f8eSopenharmony_ci * @param { string } filePath - file path. 462261847f8eSopenharmony_ci * @param { object } [options] - options. 462361847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file. 462461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 462561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 462661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 462761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 462861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 462961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 463061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 463161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 463261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 463361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 463461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 463561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 463661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 463761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 463861847f8eSopenharmony_ci * @since 9 463961847f8eSopenharmony_ci */ 464061847f8eSopenharmony_ci/** 464161847f8eSopenharmony_ci * Read text. 464261847f8eSopenharmony_ci * 464361847f8eSopenharmony_ci * @param { string } filePath - file path. 464461847f8eSopenharmony_ci * @param { object } [options] - options. 464561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file. 464661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 464761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 464861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 464961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 465061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 465161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 465261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 465361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 465461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 465561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 465661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 465761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 465861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 465961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 466061847f8eSopenharmony_ci * @crossplatform 466161847f8eSopenharmony_ci * @since 10 466261847f8eSopenharmony_ci */ 466361847f8eSopenharmony_ci/** 466461847f8eSopenharmony_ci * Read text. 466561847f8eSopenharmony_ci * 466661847f8eSopenharmony_ci * @param { string } filePath - file path. 466761847f8eSopenharmony_ci * @param { ReadTextOptions } [options] - options. 466861847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file. 466961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 467061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 467161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 467261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 467361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 467461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 467561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 467661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 467761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 467861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 467961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 468061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 468161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 468261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 468361847f8eSopenharmony_ci * @crossplatform 468461847f8eSopenharmony_ci * @atomicservice 468561847f8eSopenharmony_ci * @since 11 468661847f8eSopenharmony_ci */ 468761847f8eSopenharmony_cideclare function readText( 468861847f8eSopenharmony_ci filePath: string, 468961847f8eSopenharmony_ci options: ReadTextOptions, 469061847f8eSopenharmony_ci callback: AsyncCallback<string> 469161847f8eSopenharmony_ci): void; 469261847f8eSopenharmony_ci 469361847f8eSopenharmony_ci/** 469461847f8eSopenharmony_ci * Read text with sync interface. 469561847f8eSopenharmony_ci * 469661847f8eSopenharmony_ci * @param { string } filePath - file path. 469761847f8eSopenharmony_ci * @param { object } [options] - options. 469861847f8eSopenharmony_ci * @returns { string } Returns the contents of the read file. 469961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 470061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 470161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 470261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 470361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 470461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 470561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 470661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 470761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 470861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 470961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 471061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 471161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 471261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 471361847f8eSopenharmony_ci * @since 9 471461847f8eSopenharmony_ci */ 471561847f8eSopenharmony_ci/** 471661847f8eSopenharmony_ci * Read text with sync interface. 471761847f8eSopenharmony_ci * 471861847f8eSopenharmony_ci * @param { string } filePath - file path. 471961847f8eSopenharmony_ci * @param { object } [options] - options. 472061847f8eSopenharmony_ci * @returns { string } Returns the contents of the read file. 472161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 472261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 472361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 472461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 472561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 472661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 472761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 472861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 472961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 473061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 473161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 473261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 473361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 473461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 473561847f8eSopenharmony_ci * @crossplatform 473661847f8eSopenharmony_ci * @since 10 473761847f8eSopenharmony_ci */ 473861847f8eSopenharmony_ci/** 473961847f8eSopenharmony_ci * Read text with sync interface. 474061847f8eSopenharmony_ci * 474161847f8eSopenharmony_ci * @param { string } filePath - file path. 474261847f8eSopenharmony_ci * @param { ReadTextOptions } [options] - options. 474361847f8eSopenharmony_ci * @returns { string } Returns the contents of the read file. 474461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 474561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 474661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 474761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 474861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 474961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 475061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 475161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 475261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 475361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 475461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 475561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 475661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 475761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 475861847f8eSopenharmony_ci * @crossplatform 475961847f8eSopenharmony_ci * @atomicservice 476061847f8eSopenharmony_ci * @since 11 476161847f8eSopenharmony_ci */ 476261847f8eSopenharmony_ci/** 476361847f8eSopenharmony_ci * Read text with sync interface. 476461847f8eSopenharmony_ci * 476561847f8eSopenharmony_ci * @param { string } filePath - file path. 476661847f8eSopenharmony_ci * @param { ReadTextOptions } [options] - options. 476761847f8eSopenharmony_ci * @returns { string } Returns the contents of the read file. 476861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 476961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 477061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 477161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 477261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 477361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 477461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 477561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 477661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 477761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 477861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 477961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 478061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 478161847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 478261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 478361847f8eSopenharmony_ci * @crossplatform 478461847f8eSopenharmony_ci * @atomicservice 478561847f8eSopenharmony_ci * @since 12 478661847f8eSopenharmony_ci */ 478761847f8eSopenharmony_cideclare function readTextSync( 478861847f8eSopenharmony_ci filePath: string, 478961847f8eSopenharmony_ci options?: ReadTextOptions 479061847f8eSopenharmony_ci): string; 479161847f8eSopenharmony_ci 479261847f8eSopenharmony_ci/** 479361847f8eSopenharmony_ci * Rename file. 479461847f8eSopenharmony_ci * 479561847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 479661847f8eSopenharmony_ci * @param { string } newPath - newPath. 479761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 479861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 479961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 480061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 480161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 480261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 480361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 480461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 480561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 480661847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 480761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 480861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 480961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 481061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 481161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 481261847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 481361847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 481461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 481561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 481661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 481761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 481861847f8eSopenharmony_ci * @since 9 481961847f8eSopenharmony_ci */ 482061847f8eSopenharmony_ci/** 482161847f8eSopenharmony_ci * Rename file. 482261847f8eSopenharmony_ci * 482361847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 482461847f8eSopenharmony_ci * @param { string } newPath - newPath. 482561847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 482661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 482761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 482861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 482961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 483061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 483161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 483261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 483361847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 483461847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 483561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 483661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 483761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 483861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 483961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 484061847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 484161847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 484261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 484361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 484461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 484561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 484661847f8eSopenharmony_ci * @crossplatform 484761847f8eSopenharmony_ci * @since 10 484861847f8eSopenharmony_ci */ 484961847f8eSopenharmony_ci/** 485061847f8eSopenharmony_ci * Rename file. 485161847f8eSopenharmony_ci * 485261847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 485361847f8eSopenharmony_ci * @param { string } newPath - newPath. 485461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 485561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 485661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 485761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 485861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 485961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 486061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 486161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 486261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 486361847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 486461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 486561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 486661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 486761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 486861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 486961847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 487061847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 487161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 487261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 487361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 487461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 487561847f8eSopenharmony_ci * @crossplatform 487661847f8eSopenharmony_ci * @atomicservice 487761847f8eSopenharmony_ci * @since 11 487861847f8eSopenharmony_ci */ 487961847f8eSopenharmony_cideclare function rename(oldPath: string, newPath: string): Promise<void>; 488061847f8eSopenharmony_ci 488161847f8eSopenharmony_ci/** 488261847f8eSopenharmony_ci * Rename file. 488361847f8eSopenharmony_ci * 488461847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 488561847f8eSopenharmony_ci * @param { string } newPath - newPath. 488661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Returns the callback function. 488761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 488861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 488961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 489061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 489161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 489261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 489361847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 489461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 489561847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 489661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 489761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 489861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 489961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 490061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 490161847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 490261847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 490361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 490461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 490561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 490661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 490761847f8eSopenharmony_ci * @since 9 490861847f8eSopenharmony_ci */ 490961847f8eSopenharmony_ci/** 491061847f8eSopenharmony_ci * Rename file. 491161847f8eSopenharmony_ci * 491261847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 491361847f8eSopenharmony_ci * @param { string } newPath - newPath. 491461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Returns the callback function. 491561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 491661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 491761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 491861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 491961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 492061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 492161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 492261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 492361847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 492461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 492561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 492661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 492761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 492861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 492961847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 493061847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 493161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 493261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 493361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 493461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 493561847f8eSopenharmony_ci * @crossplatform 493661847f8eSopenharmony_ci * @since 10 493761847f8eSopenharmony_ci */ 493861847f8eSopenharmony_ci/** 493961847f8eSopenharmony_ci * Rename file. 494061847f8eSopenharmony_ci * 494161847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 494261847f8eSopenharmony_ci * @param { string } newPath - newPath. 494361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Returns the callback function. 494461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 494561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 494661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 494761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 494861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 494961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 495061847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 495161847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 495261847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 495361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 495461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 495561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 495661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 495761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 495861847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 495961847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 496061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 496161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 496261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 496361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 496461847f8eSopenharmony_ci * @crossplatform 496561847f8eSopenharmony_ci * @atomicservice 496661847f8eSopenharmony_ci * @since 11 496761847f8eSopenharmony_ci */ 496861847f8eSopenharmony_cideclare function rename(oldPath: string, newPath: string, callback: AsyncCallback<void>): void; 496961847f8eSopenharmony_ci 497061847f8eSopenharmony_ci/** 497161847f8eSopenharmony_ci * Rename file with sync interface. 497261847f8eSopenharmony_ci * 497361847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 497461847f8eSopenharmony_ci * @param { string } newPath - newPath. 497561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 497661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 497761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 497861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 497961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 498061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 498161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 498261847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 498361847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 498461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 498561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 498661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 498761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 498861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 498961847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 499061847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 499161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 499261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 499361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 499461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 499561847f8eSopenharmony_ci * @since 9 499661847f8eSopenharmony_ci */ 499761847f8eSopenharmony_ci/** 499861847f8eSopenharmony_ci * Rename file with sync interface. 499961847f8eSopenharmony_ci * 500061847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 500161847f8eSopenharmony_ci * @param { string } newPath - newPath. 500261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 500361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 500461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 500561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 500661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 500761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 500861847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 500961847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 501061847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 501161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 501261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 501361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 501461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 501561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 501661847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 501761847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 501861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 501961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 502061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 502161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 502261847f8eSopenharmony_ci * @crossplatform 502361847f8eSopenharmony_ci * @since 10 502461847f8eSopenharmony_ci */ 502561847f8eSopenharmony_ci/** 502661847f8eSopenharmony_ci * Rename file with sync interface. 502761847f8eSopenharmony_ci * 502861847f8eSopenharmony_ci * @param { string } oldPath - oldPath. 502961847f8eSopenharmony_ci * @param { string } newPath - newPath. 503061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 503161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 503261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 503361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 503461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 503561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 503661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 503761847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 503861847f8eSopenharmony_ci * @throws { BusinessError } 13900016 - Cross-device link 503961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 504061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 504161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 504261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 504361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 504461847f8eSopenharmony_ci * @throws { BusinessError } 13900028 - Too many links 504561847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 504661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 504761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 504861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 504961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 505061847f8eSopenharmony_ci * @crossplatform 505161847f8eSopenharmony_ci * @atomicservice 505261847f8eSopenharmony_ci * @since 11 505361847f8eSopenharmony_ci */ 505461847f8eSopenharmony_cideclare function renameSync(oldPath: string, newPath: string): void; 505561847f8eSopenharmony_ci 505661847f8eSopenharmony_ci/** 505761847f8eSopenharmony_ci * Delete dir. 505861847f8eSopenharmony_ci * 505961847f8eSopenharmony_ci * @param { string } path - path. 506061847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 506161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 506261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 506361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 506461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 506561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 506661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 506761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 506861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 506961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 507061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 507161847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 507261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 507361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 507461847f8eSopenharmony_ci * @since 9 507561847f8eSopenharmony_ci */ 507661847f8eSopenharmony_ci/** 507761847f8eSopenharmony_ci * Delete dir. 507861847f8eSopenharmony_ci * 507961847f8eSopenharmony_ci * @param { string } path - path. 508061847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 508161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 508261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 508361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 508461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 508561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 508661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 508761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 508861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 508961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 509061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 509161847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 509261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 509361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 509461847f8eSopenharmony_ci * @crossplatform 509561847f8eSopenharmony_ci * @since 10 509661847f8eSopenharmony_ci */ 509761847f8eSopenharmony_ci/** 509861847f8eSopenharmony_ci * Delete dir. 509961847f8eSopenharmony_ci * 510061847f8eSopenharmony_ci * @param { string } path - path. 510161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 510261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 510361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 510461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 510561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 510661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 510761847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 510861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 510961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 511061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 511161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 511261847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 511361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 511461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 511561847f8eSopenharmony_ci * @crossplatform 511661847f8eSopenharmony_ci * @atomicservice 511761847f8eSopenharmony_ci * @since 11 511861847f8eSopenharmony_ci */ 511961847f8eSopenharmony_cideclare function rmdir(path: string): Promise<void>; 512061847f8eSopenharmony_ci 512161847f8eSopenharmony_ci/** 512261847f8eSopenharmony_ci * Delete dir. 512361847f8eSopenharmony_ci * 512461847f8eSopenharmony_ci * @param { string } path - path. 512561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 512661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 512761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 512861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 512961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 513061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 513161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 513261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 513361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 513461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 513561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 513661847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 513761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 513861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 513961847f8eSopenharmony_ci * @since 9 514061847f8eSopenharmony_ci */ 514161847f8eSopenharmony_ci/** 514261847f8eSopenharmony_ci * Delete dir. 514361847f8eSopenharmony_ci * 514461847f8eSopenharmony_ci * @param { string } path - path. 514561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 514661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 514761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 514861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 514961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 515061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 515161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 515261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 515361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 515461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 515561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 515661847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 515761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 515861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 515961847f8eSopenharmony_ci * @crossplatform 516061847f8eSopenharmony_ci * @since 10 516161847f8eSopenharmony_ci */ 516261847f8eSopenharmony_ci/** 516361847f8eSopenharmony_ci * Delete dir. 516461847f8eSopenharmony_ci * 516561847f8eSopenharmony_ci * @param { string } path - path. 516661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 516761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 516861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 516961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 517061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 517161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 517261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 517361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 517461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 517561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 517661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 517761847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 517861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 517961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 518061847f8eSopenharmony_ci * @crossplatform 518161847f8eSopenharmony_ci * @atomicservice 518261847f8eSopenharmony_ci * @since 11 518361847f8eSopenharmony_ci */ 518461847f8eSopenharmony_cideclare function rmdir(path: string, callback: AsyncCallback<void>): void; 518561847f8eSopenharmony_ci 518661847f8eSopenharmony_ci/** 518761847f8eSopenharmony_ci * Delete dir with sync interface. 518861847f8eSopenharmony_ci * 518961847f8eSopenharmony_ci * @param { string } path - path. 519061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 519161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 519261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 519361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 519461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 519561847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 519661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 519761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 519861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 519961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 520061847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 520161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 520261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 520361847f8eSopenharmony_ci * @since 9 520461847f8eSopenharmony_ci */ 520561847f8eSopenharmony_ci/** 520661847f8eSopenharmony_ci * Delete dir with sync interface. 520761847f8eSopenharmony_ci * 520861847f8eSopenharmony_ci * @param { string } path - path. 520961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 521061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 521161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 521261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 521361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 521461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 521561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 521661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 521761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 521861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 521961847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 522061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 522161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 522261847f8eSopenharmony_ci * @crossplatform 522361847f8eSopenharmony_ci * @since 10 522461847f8eSopenharmony_ci */ 522561847f8eSopenharmony_ci/** 522661847f8eSopenharmony_ci * Delete dir with sync interface. 522761847f8eSopenharmony_ci * 522861847f8eSopenharmony_ci * @param { string } path - path. 522961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 523061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 523161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 523261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 523361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 523461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 523561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 523661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 523761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system1 523861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 523961847f8eSopenharmony_ci * @throws { BusinessError } 13900032 - Directory not empty 524061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 524161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 524261847f8eSopenharmony_ci * @crossplatform 524361847f8eSopenharmony_ci * @atomicservice 524461847f8eSopenharmony_ci * @since 11 524561847f8eSopenharmony_ci */ 524661847f8eSopenharmony_cideclare function rmdirSync(path: string): void; 524761847f8eSopenharmony_ci 524861847f8eSopenharmony_ci/** 524961847f8eSopenharmony_ci * Get file information. 525061847f8eSopenharmony_ci * 525161847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 525261847f8eSopenharmony_ci * @returns { Promise<Stat> } Returns the Stat object in promise mode. 525361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 525461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 525561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 525661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 525761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 525861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 525961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 526061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 526161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 526261847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 526361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 526461847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 526561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 526661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 526761847f8eSopenharmony_ci * @since 9 526861847f8eSopenharmony_ci */ 526961847f8eSopenharmony_ci/** 527061847f8eSopenharmony_ci * Get file information. 527161847f8eSopenharmony_ci * 527261847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 527361847f8eSopenharmony_ci * @returns { Promise<Stat> } Returns the Stat object in promise mode. 527461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 527561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 527661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 527761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 527861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 527961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 528061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 528161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 528261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 528361847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 528461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 528561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 528661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 528761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 528861847f8eSopenharmony_ci * @crossplatform 528961847f8eSopenharmony_ci * @since 10 529061847f8eSopenharmony_ci */ 529161847f8eSopenharmony_ci/** 529261847f8eSopenharmony_ci * Get file information. 529361847f8eSopenharmony_ci * 529461847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 529561847f8eSopenharmony_ci * @returns { Promise<Stat> } Returns the Stat object in promise mode. 529661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 529761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 529861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 529961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 530061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 530161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 530261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 530361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 530461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 530561847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 530661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 530761847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 530861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 530961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 531061847f8eSopenharmony_ci * @crossplatform 531161847f8eSopenharmony_ci * @atomicservice 531261847f8eSopenharmony_ci * @since 11 531361847f8eSopenharmony_ci */ 531461847f8eSopenharmony_cideclare function stat(file: string | number): Promise<Stat>; 531561847f8eSopenharmony_ci 531661847f8eSopenharmony_ci/** 531761847f8eSopenharmony_ci * Get file information. 531861847f8eSopenharmony_ci * 531961847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 532061847f8eSopenharmony_ci * @param { AsyncCallback<Stat> } callback - The callback is used to return the Stat object. 532161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 532261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 532361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 532461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 532561847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 532661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 532761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 532861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 532961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 533061847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 533161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 533261847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 533361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 533461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 533561847f8eSopenharmony_ci * @since 9 533661847f8eSopenharmony_ci */ 533761847f8eSopenharmony_ci/** 533861847f8eSopenharmony_ci * Get file information. 533961847f8eSopenharmony_ci * 534061847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 534161847f8eSopenharmony_ci * @param { AsyncCallback<Stat> } callback - The callback is used to return the Stat object. 534261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 534361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 534461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 534561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 534661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 534761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 534861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 534961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 535061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 535161847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 535261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 535361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 535461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 535561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 535661847f8eSopenharmony_ci * @crossplatform 535761847f8eSopenharmony_ci * @since 10 535861847f8eSopenharmony_ci */ 535961847f8eSopenharmony_ci/** 536061847f8eSopenharmony_ci * Get file information. 536161847f8eSopenharmony_ci * 536261847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 536361847f8eSopenharmony_ci * @param { AsyncCallback<Stat> } callback - The callback is used to return the Stat object. 536461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 536561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 536661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 536761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 536861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 536961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 537061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 537161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 537261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 537361847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 537461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 537561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 537661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 537761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 537861847f8eSopenharmony_ci * @crossplatform 537961847f8eSopenharmony_ci * @atomicservice 538061847f8eSopenharmony_ci * @since 11 538161847f8eSopenharmony_ci */ 538261847f8eSopenharmony_cideclare function stat(file: string | number, callback: AsyncCallback<Stat>): void; 538361847f8eSopenharmony_ci 538461847f8eSopenharmony_ci/** 538561847f8eSopenharmony_ci * Get file information with sync interface. 538661847f8eSopenharmony_ci * 538761847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 538861847f8eSopenharmony_ci * @returns { Stat } Returns the Stat object. 538961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 539061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 539161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 539261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 539361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 539461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 539561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 539661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 539761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 539861847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 539961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 540061847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 540161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 540261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 540361847f8eSopenharmony_ci * @since 9 540461847f8eSopenharmony_ci */ 540561847f8eSopenharmony_ci/** 540661847f8eSopenharmony_ci * Get file information with sync interface. 540761847f8eSopenharmony_ci * 540861847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 540961847f8eSopenharmony_ci * @returns { Stat } Returns the Stat object. 541061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 541161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 541261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 541361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 541461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 541561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 541661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 541761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 541861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 541961847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 542061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 542161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 542261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 542361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 542461847f8eSopenharmony_ci * @crossplatform 542561847f8eSopenharmony_ci * @since 10 542661847f8eSopenharmony_ci */ 542761847f8eSopenharmony_ci/** 542861847f8eSopenharmony_ci * Get file information with sync interface. 542961847f8eSopenharmony_ci * 543061847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 543161847f8eSopenharmony_ci * @returns { Stat } Returns the Stat object. 543261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 543361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 543461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 543561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 543661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 543761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 543861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 543961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 544061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 544161847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 544261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 544361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 544461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 544561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 544661847f8eSopenharmony_ci * @crossplatform 544761847f8eSopenharmony_ci * @atomicservice 544861847f8eSopenharmony_ci * @since 11 544961847f8eSopenharmony_ci */ 545061847f8eSopenharmony_cideclare function statSync(file: string | number): Stat; 545161847f8eSopenharmony_ci 545261847f8eSopenharmony_ci/** 545361847f8eSopenharmony_ci * Link file. 545461847f8eSopenharmony_ci * 545561847f8eSopenharmony_ci * @param { string } target - target. 545661847f8eSopenharmony_ci * @param { string } srcPath - srcPath. 545761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 545861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 545961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 546061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 546161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 546261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 546361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 546461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 546561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 546661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 546761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 546861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 546961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 547061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 547161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 547261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 547361847f8eSopenharmony_ci * @since 9 547461847f8eSopenharmony_ci */ 547561847f8eSopenharmony_cideclare function symlink(target: string, srcPath: string): Promise<void>; 547661847f8eSopenharmony_ci 547761847f8eSopenharmony_ci/** 547861847f8eSopenharmony_ci * Link file. 547961847f8eSopenharmony_ci * 548061847f8eSopenharmony_ci * @param { string } target - target. 548161847f8eSopenharmony_ci * @param { string } srcPath - srcPath. 548261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 548361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 548461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 548561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 548661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 548761847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 548861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 548961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 549061847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 549161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 549261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 549361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 549461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 549561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 549661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 549761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 549861847f8eSopenharmony_ci * @since 9 549961847f8eSopenharmony_ci */ 550061847f8eSopenharmony_cideclare function symlink(target: string, srcPath: string, callback: AsyncCallback<void>): void; 550161847f8eSopenharmony_ci 550261847f8eSopenharmony_ci/** 550361847f8eSopenharmony_ci * Link file with sync interface. 550461847f8eSopenharmony_ci * 550561847f8eSopenharmony_ci * @param { string } target - target. 550661847f8eSopenharmony_ci * @param { string } srcPath - srcPath. 550761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 550861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 550961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 551061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 551161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 551261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 551361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 551461847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 551561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 551661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 551761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 551861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 551961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 552061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 552161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 552261847f8eSopenharmony_ci * @since 9 552361847f8eSopenharmony_ci */ 552461847f8eSopenharmony_cideclare function symlinkSync(target: string, srcPath: string): void; 552561847f8eSopenharmony_ci 552661847f8eSopenharmony_ci/** 552761847f8eSopenharmony_ci * Truncate file. 552861847f8eSopenharmony_ci * 552961847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 553061847f8eSopenharmony_ci * @param { number } [len = 0] - len. 553161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 553261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 553361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 553461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 553561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 553661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 553761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 553861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 553961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 554061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 554161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 554261847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 554361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 554461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 554561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 554661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 554761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 554861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 554961847f8eSopenharmony_ci * @since 9 555061847f8eSopenharmony_ci */ 555161847f8eSopenharmony_ci/** 555261847f8eSopenharmony_ci * Truncate file. 555361847f8eSopenharmony_ci * 555461847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 555561847f8eSopenharmony_ci * @param { number } [len = 0] - len. 555661847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 555761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 555861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 555961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 556061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 556161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 556261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 556361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 556461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 556561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 556661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 556761847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 556861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 556961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 557061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 557161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 557261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 557361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 557461847f8eSopenharmony_ci * @crossplatform 557561847f8eSopenharmony_ci * @since 10 557661847f8eSopenharmony_ci */ 557761847f8eSopenharmony_ci/** 557861847f8eSopenharmony_ci * Truncate file. 557961847f8eSopenharmony_ci * 558061847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 558161847f8eSopenharmony_ci * @param { number } [len = 0] - len. 558261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 558361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 558461847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 558561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 558661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 558761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 558861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 558961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 559061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 559161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 559261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 559361847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 559461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 559561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 559661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 559761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 559861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 559961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 560061847f8eSopenharmony_ci * @crossplatform 560161847f8eSopenharmony_ci * @atomicservice 560261847f8eSopenharmony_ci * @since 11 560361847f8eSopenharmony_ci */ 560461847f8eSopenharmony_cideclare function truncate(file: string | number, len?: number): Promise<void>; 560561847f8eSopenharmony_ci 560661847f8eSopenharmony_ci/** 560761847f8eSopenharmony_ci * Truncate file. 560861847f8eSopenharmony_ci * 560961847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 561061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 561161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 561261847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 561361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 561461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 561561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 561661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 561761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 561861847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 561961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 562061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 562161847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 562261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 562361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 562461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 562561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 562661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 562761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 562861847f8eSopenharmony_ci * @since 9 562961847f8eSopenharmony_ci */ 563061847f8eSopenharmony_ci/** 563161847f8eSopenharmony_ci * Truncate file. 563261847f8eSopenharmony_ci * 563361847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 563461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 563561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 563661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 563761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 563861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 563961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 564061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 564161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 564261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 564361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 564461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 564561847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 564661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 564761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 564861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 564961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 565061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 565161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 565261847f8eSopenharmony_ci * @crossplatform 565361847f8eSopenharmony_ci * @since 10 565461847f8eSopenharmony_ci */ 565561847f8eSopenharmony_ci/** 565661847f8eSopenharmony_ci * Truncate file. 565761847f8eSopenharmony_ci * 565861847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 565961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 566061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 566161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 566261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 566361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 566461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 566561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 566661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 566761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 566861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 566961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 567061847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 567161847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 567261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 567361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 567461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 567561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 567661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 567761847f8eSopenharmony_ci * @crossplatform 567861847f8eSopenharmony_ci * @atomicservice 567961847f8eSopenharmony_ci * @since 11 568061847f8eSopenharmony_ci */ 568161847f8eSopenharmony_cideclare function truncate(file: string | number, callback: AsyncCallback<void>): void; 568261847f8eSopenharmony_ci 568361847f8eSopenharmony_ci/** 568461847f8eSopenharmony_ci * Truncate file. 568561847f8eSopenharmony_ci * 568661847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 568761847f8eSopenharmony_ci * @param { number } [len = 0] - len. 568861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 568961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 569061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 569161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 569261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 569361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 569461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 569561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 569661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 569761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 569861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 569961847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 570061847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 570161847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 570261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 570361847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 570461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 570561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 570661847f8eSopenharmony_ci * @since 9 570761847f8eSopenharmony_ci */ 570861847f8eSopenharmony_ci/** 570961847f8eSopenharmony_ci * Truncate file. 571061847f8eSopenharmony_ci * 571161847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 571261847f8eSopenharmony_ci * @param { number } [len = 0] - len. 571361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 571461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 571561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 571661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 571761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 571861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 571961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 572061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 572161847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 572261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 572361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 572461847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 572561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 572661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 572761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 572861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 572961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 573061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 573161847f8eSopenharmony_ci * @crossplatform 573261847f8eSopenharmony_ci * @since 10 573361847f8eSopenharmony_ci */ 573461847f8eSopenharmony_ci/** 573561847f8eSopenharmony_ci * Truncate file. 573661847f8eSopenharmony_ci * 573761847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 573861847f8eSopenharmony_ci * @param { number } [len = 0] - len. 573961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 574061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 574161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 574261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 574361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 574461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 574561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 574661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 574761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 574861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 574961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 575061847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 575161847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 575261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 575361847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 575461847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 575561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 575661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 575761847f8eSopenharmony_ci * @crossplatform 575861847f8eSopenharmony_ci * @atomicservice 575961847f8eSopenharmony_ci * @since 11 576061847f8eSopenharmony_ci */ 576161847f8eSopenharmony_cideclare function truncate(file: string | number, len: number, callback: AsyncCallback<void>): void; 576261847f8eSopenharmony_ci 576361847f8eSopenharmony_ci/** 576461847f8eSopenharmony_ci * Truncate file with sync interface. 576561847f8eSopenharmony_ci * 576661847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 576761847f8eSopenharmony_ci * @param { number } [len = 0] - len. 576861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 576961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 577061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 577161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 577261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 577361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 577461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 577561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 577661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 577761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 577861847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 577961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 578061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 578161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 578261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 578361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 578461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 578561847f8eSopenharmony_ci * @since 9 578661847f8eSopenharmony_ci */ 578761847f8eSopenharmony_ci/** 578861847f8eSopenharmony_ci * Truncate file with sync interface. 578961847f8eSopenharmony_ci * 579061847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 579161847f8eSopenharmony_ci * @param { number } [len = 0] - len. 579261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 579361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 579461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 579561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 579661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 579761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 579861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 579961847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 580061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 580161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 580261847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 580361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 580461847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 580561847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 580661847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 580761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 580861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 580961847f8eSopenharmony_ci * @crossplatform 581061847f8eSopenharmony_ci * @since 10 581161847f8eSopenharmony_ci */ 581261847f8eSopenharmony_ci/** 581361847f8eSopenharmony_ci * Truncate file with sync interface. 581461847f8eSopenharmony_ci * 581561847f8eSopenharmony_ci * @param { string | number } file - path or file descriptor. 581661847f8eSopenharmony_ci * @param { number } [len = 0] - len. 581761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 581861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 581961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 582061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 582161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 582261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 582361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 582461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 582561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 582661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 582761847f8eSopenharmony_ci * @throws { BusinessError } 13900023 - Text file busy 582861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 582961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 583061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 583161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 583261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 583361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 583461847f8eSopenharmony_ci * @crossplatform 583561847f8eSopenharmony_ci * @atomicservice 583661847f8eSopenharmony_ci * @since 11 583761847f8eSopenharmony_ci */ 583861847f8eSopenharmony_cideclare function truncateSync(file: string | number, len?: number): void; 583961847f8eSopenharmony_ci 584061847f8eSopenharmony_ci/** 584161847f8eSopenharmony_ci * Delete file. 584261847f8eSopenharmony_ci * 584361847f8eSopenharmony_ci * @param { string } path - path. 584461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 584561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 584661847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 584761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 584861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 584961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 585061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 585161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 585261847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 585361847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 585461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 585561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 585661847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 585761847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 585861847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 585961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 586061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 586161847f8eSopenharmony_ci * @since 9 586261847f8eSopenharmony_ci */ 586361847f8eSopenharmony_ci/** 586461847f8eSopenharmony_ci * Delete file. 586561847f8eSopenharmony_ci * 586661847f8eSopenharmony_ci * @param { string } path - path. 586761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 586861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 586961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 587061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 587161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 587261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 587361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 587461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 587561847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 587661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 587761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 587861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 587961847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 588061847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 588161847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 588261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 588361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 588461847f8eSopenharmony_ci * @crossplatform 588561847f8eSopenharmony_ci * @since 10 588661847f8eSopenharmony_ci */ 588761847f8eSopenharmony_ci/** 588861847f8eSopenharmony_ci * Delete file. 588961847f8eSopenharmony_ci * 589061847f8eSopenharmony_ci * @param { string } path - path. 589161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 589261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 589361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 589461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 589561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 589661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 589761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 589861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 589961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 590061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 590161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 590261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 590361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 590461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 590561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 590661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 590761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 590861847f8eSopenharmony_ci * @crossplatform 590961847f8eSopenharmony_ci * @atomicservice 591061847f8eSopenharmony_ci * @since 11 591161847f8eSopenharmony_ci */ 591261847f8eSopenharmony_cideclare function unlink(path: string): Promise<void>; 591361847f8eSopenharmony_ci 591461847f8eSopenharmony_ci/** 591561847f8eSopenharmony_ci * Delete file. 591661847f8eSopenharmony_ci * 591761847f8eSopenharmony_ci * @param { string } path - path. 591861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 591961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 592061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 592161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 592261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 592361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 592461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 592561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 592661847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 592761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 592861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 592961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 593061847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 593161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 593261847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 593361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 593461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 593561847f8eSopenharmony_ci * @since 9 593661847f8eSopenharmony_ci */ 593761847f8eSopenharmony_ci/** 593861847f8eSopenharmony_ci * Delete file. 593961847f8eSopenharmony_ci * 594061847f8eSopenharmony_ci * @param { string } path - path. 594161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 594261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 594361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 594461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 594561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 594661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 594761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 594861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 594961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 595061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 595161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 595261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 595361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 595461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 595561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 595661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 595761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 595861847f8eSopenharmony_ci * @crossplatform 595961847f8eSopenharmony_ci * @since 10 596061847f8eSopenharmony_ci */ 596161847f8eSopenharmony_ci/** 596261847f8eSopenharmony_ci * Delete file. 596361847f8eSopenharmony_ci * 596461847f8eSopenharmony_ci * @param { string } path - path. 596561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 596661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 596761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 596861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 596961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 597061847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 597161847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 597261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 597361847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 597461847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 597561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 597661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 597761847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 597861847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 597961847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 598061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 598161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 598261847f8eSopenharmony_ci * @crossplatform 598361847f8eSopenharmony_ci * @atomicservice 598461847f8eSopenharmony_ci * @since 11 598561847f8eSopenharmony_ci */ 598661847f8eSopenharmony_cideclare function unlink(path: string, callback: AsyncCallback<void>): void; 598761847f8eSopenharmony_ci 598861847f8eSopenharmony_ci/** 598961847f8eSopenharmony_ci * Delete file with sync interface. 599061847f8eSopenharmony_ci * 599161847f8eSopenharmony_ci * @param { string } path - path. 599261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 599361847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 599461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 599561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 599661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 599761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 599861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 599961847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 600061847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 600161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 600261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 600361847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 600461847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 600561847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 600661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 600761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 600861847f8eSopenharmony_ci * @since 9 600961847f8eSopenharmony_ci */ 601061847f8eSopenharmony_ci/** 601161847f8eSopenharmony_ci * Delete file with sync interface. 601261847f8eSopenharmony_ci * 601361847f8eSopenharmony_ci * @param { string } path - path. 601461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 601561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 601661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 601761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 601861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 601961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 602061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 602161847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 602261847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 602361847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 602461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 602561847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 602661847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 602761847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 602861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 602961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 603061847f8eSopenharmony_ci * @crossplatform 603161847f8eSopenharmony_ci * @since 10 603261847f8eSopenharmony_ci */ 603361847f8eSopenharmony_ci/** 603461847f8eSopenharmony_ci * Delete file with sync interface. 603561847f8eSopenharmony_ci * 603661847f8eSopenharmony_ci * @param { string } path - path. 603761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 603861847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 603961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 604061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 604161847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 604261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 604361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 604461847f8eSopenharmony_ci * @throws { BusinessError } 13900014 - Device or resource busy 604561847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 604661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 604761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 604861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 604961847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 605061847f8eSopenharmony_ci * @throws { BusinessError } 13900033 - Too many symbolic links encountered 605161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 605261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 605361847f8eSopenharmony_ci * @crossplatform 605461847f8eSopenharmony_ci * @atomicservice 605561847f8eSopenharmony_ci * @since 11 605661847f8eSopenharmony_ci */ 605761847f8eSopenharmony_cideclare function unlinkSync(path: string): void; 605861847f8eSopenharmony_ci 605961847f8eSopenharmony_ci/** 606061847f8eSopenharmony_ci * Change file mtime. 606161847f8eSopenharmony_ci * 606261847f8eSopenharmony_ci * @param { string } path - path. 606361847f8eSopenharmony_ci * @param { number } mtime - last modification time 606461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 606561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 606661847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 606761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 606861847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 606961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 607061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 607161847f8eSopenharmony_ci * @since 11 607261847f8eSopenharmony_ci */ 607361847f8eSopenharmony_ci/** 607461847f8eSopenharmony_ci * Change file mtime. 607561847f8eSopenharmony_ci * 607661847f8eSopenharmony_ci * @param { string } path - path. 607761847f8eSopenharmony_ci * @param { number } mtime - last modification time 607861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 607961847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 608061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 608161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 608261847f8eSopenharmony_ci * @throws { BusinessError } 13900027 - Read-only file system 608361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 608461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 608561847f8eSopenharmony_ci * @crossplatform 608661847f8eSopenharmony_ci * @since 12 608761847f8eSopenharmony_ci */ 608861847f8eSopenharmony_cideclare function utimes(path: string, mtime: number): void; 608961847f8eSopenharmony_ci 609061847f8eSopenharmony_ci/** 609161847f8eSopenharmony_ci * Write file. 609261847f8eSopenharmony_ci * 609361847f8eSopenharmony_ci * @param { number } fd - file descriptor. 609461847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 609561847f8eSopenharmony_ci * @param { object } [options] - options. 609661847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode. 609761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 609861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 609961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 610061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 610161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 610261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 610361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 610461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 610561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 610661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 610761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 610861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 610961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 611061847f8eSopenharmony_ci * @since 9 611161847f8eSopenharmony_ci */ 611261847f8eSopenharmony_ci/** 611361847f8eSopenharmony_ci * Write file. 611461847f8eSopenharmony_ci * 611561847f8eSopenharmony_ci * @param { number } fd - file descriptor. 611661847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 611761847f8eSopenharmony_ci * @param { object } [options] - options. 611861847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode. 611961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 612061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 612161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 612261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 612361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 612461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 612561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 612661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 612761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 612861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 612961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 613061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 613161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 613261847f8eSopenharmony_ci * @crossplatform 613361847f8eSopenharmony_ci * @since 10 613461847f8eSopenharmony_ci */ 613561847f8eSopenharmony_ci/** 613661847f8eSopenharmony_ci * Write file. 613761847f8eSopenharmony_ci * 613861847f8eSopenharmony_ci * @param { number } fd - file descriptor. 613961847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 614061847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 614161847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode. 614261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 614361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 614461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 614561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 614661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 614761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 614861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 614961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 615061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 615161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 615261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 615361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 615461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 615561847f8eSopenharmony_ci * @crossplatform 615661847f8eSopenharmony_ci * @atomicservice 615761847f8eSopenharmony_ci * @since 11 615861847f8eSopenharmony_ci */ 615961847f8eSopenharmony_cideclare function write( 616061847f8eSopenharmony_ci fd: number, 616161847f8eSopenharmony_ci buffer: ArrayBuffer | string, 616261847f8eSopenharmony_ci options?: WriteOptions 616361847f8eSopenharmony_ci): Promise<number>; 616461847f8eSopenharmony_ci 616561847f8eSopenharmony_ci/** 616661847f8eSopenharmony_ci * Write file. 616761847f8eSopenharmony_ci * 616861847f8eSopenharmony_ci * @param { number } fd - file descriptor. 616961847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 617061847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 617161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 617261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 617361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 617461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 617561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 617661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 617761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 617861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 617961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 618061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 618161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 618261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 618361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 618461847f8eSopenharmony_ci * @since 9 618561847f8eSopenharmony_ci */ 618661847f8eSopenharmony_ci/** 618761847f8eSopenharmony_ci * Write file. 618861847f8eSopenharmony_ci * 618961847f8eSopenharmony_ci * @param { number } fd - file descriptor. 619061847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 619161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 619261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 619361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 619461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 619561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 619661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 619761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 619861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 619961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 620061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 620161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 620261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 620361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 620461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 620561847f8eSopenharmony_ci * @crossplatform 620661847f8eSopenharmony_ci * @since 10 620761847f8eSopenharmony_ci */ 620861847f8eSopenharmony_ci/** 620961847f8eSopenharmony_ci * Write file. 621061847f8eSopenharmony_ci * 621161847f8eSopenharmony_ci * @param { number } fd - file descriptor. 621261847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 621361847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 621461847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 621561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 621661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 621761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 621861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 621961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 622061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 622161847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 622261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 622361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 622461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 622561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 622661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 622761847f8eSopenharmony_ci * @crossplatform 622861847f8eSopenharmony_ci * @atomicservice 622961847f8eSopenharmony_ci * @since 11 623061847f8eSopenharmony_ci */ 623161847f8eSopenharmony_cideclare function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback<number>): void; 623261847f8eSopenharmony_ci 623361847f8eSopenharmony_ci/** 623461847f8eSopenharmony_ci * Write file. 623561847f8eSopenharmony_ci * 623661847f8eSopenharmony_ci * @param { number } fd - file descriptor. 623761847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 623861847f8eSopenharmony_ci * @param { object } [options] - options. 623961847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 624061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 624161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 624261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 624361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 624461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 624561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 624661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 624761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 624861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 624961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 625061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 625161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 625261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 625361847f8eSopenharmony_ci * @since 9 625461847f8eSopenharmony_ci */ 625561847f8eSopenharmony_ci/** 625661847f8eSopenharmony_ci * Write file. 625761847f8eSopenharmony_ci * 625861847f8eSopenharmony_ci * @param { number } fd - file descriptor. 625961847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 626061847f8eSopenharmony_ci * @param { object } [options] - options. 626161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 626261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 626361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 626461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 626561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 626661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 626761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 626861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 626961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 627061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 627161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 627261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 627361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 627461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 627561847f8eSopenharmony_ci * @crossplatform 627661847f8eSopenharmony_ci * @since 10 627761847f8eSopenharmony_ci */ 627861847f8eSopenharmony_ci/** 627961847f8eSopenharmony_ci * Write file. 628061847f8eSopenharmony_ci * 628161847f8eSopenharmony_ci * @param { number } fd - file descriptor. 628261847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 628361847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 628461847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 628561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 628661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 628761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 628861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 628961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 629061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 629161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 629261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 629361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 629461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 629561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 629661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 629761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 629861847f8eSopenharmony_ci * @crossplatform 629961847f8eSopenharmony_ci * @atomicservice 630061847f8eSopenharmony_ci * @since 11 630161847f8eSopenharmony_ci */ 630261847f8eSopenharmony_cideclare function write( 630361847f8eSopenharmony_ci fd: number, 630461847f8eSopenharmony_ci buffer: ArrayBuffer | string, 630561847f8eSopenharmony_ci options: WriteOptions, 630661847f8eSopenharmony_ci callback: AsyncCallback<number> 630761847f8eSopenharmony_ci): void; 630861847f8eSopenharmony_ci 630961847f8eSopenharmony_ci/** 631061847f8eSopenharmony_ci * Write file with sync interface. 631161847f8eSopenharmony_ci * 631261847f8eSopenharmony_ci * @param { number } fd - file descriptor. 631361847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 631461847f8eSopenharmony_ci * @param { object } [options] - options. 631561847f8eSopenharmony_ci * @returns { number } Returns the number of bytes written to the file. 631661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 631761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 631861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 631961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 632061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 632161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 632261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 632361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 632461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 632561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 632661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 632761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 632861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 632961847f8eSopenharmony_ci * @since 9 633061847f8eSopenharmony_ci */ 633161847f8eSopenharmony_ci/** 633261847f8eSopenharmony_ci * Write file with sync interface. 633361847f8eSopenharmony_ci * 633461847f8eSopenharmony_ci * @param { number } fd - file descriptor. 633561847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 633661847f8eSopenharmony_ci * @param { object } [options] - options. 633761847f8eSopenharmony_ci * @returns { number } Returns the number of bytes written to the file. 633861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 633961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 634061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 634161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 634261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 634361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 634461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 634561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 634661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 634761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 634861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 634961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 635061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 635161847f8eSopenharmony_ci * @crossplatform 635261847f8eSopenharmony_ci * @since 10 635361847f8eSopenharmony_ci */ 635461847f8eSopenharmony_ci/** 635561847f8eSopenharmony_ci * Write file with sync interface. 635661847f8eSopenharmony_ci * 635761847f8eSopenharmony_ci * @param { number } fd - file descriptor. 635861847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 635961847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 636061847f8eSopenharmony_ci * @returns { number } Returns the number of bytes written to the file. 636161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 636261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 636361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 636461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 636561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 636661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 636761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 636861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 636961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 637061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 637161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 637261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 637361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 637461847f8eSopenharmony_ci * @crossplatform 637561847f8eSopenharmony_ci * @atomicservice 637661847f8eSopenharmony_ci * @since 11 637761847f8eSopenharmony_ci */ 637861847f8eSopenharmony_cideclare function writeSync( 637961847f8eSopenharmony_ci fd: number, 638061847f8eSopenharmony_ci buffer: ArrayBuffer | string, 638161847f8eSopenharmony_ci options?: WriteOptions 638261847f8eSopenharmony_ci): number; 638361847f8eSopenharmony_ci 638461847f8eSopenharmony_ci/** 638561847f8eSopenharmony_ci * Connect Distributed File System. 638661847f8eSopenharmony_ci * 638761847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 638861847f8eSopenharmony_ci * @param { string } networkId - The networkId of device. 638961847f8eSopenharmony_ci * @param { DfsListeners } listeners - The listeners of Distributed File System. 639061847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 639161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 639261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; 639361847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 639461847f8eSopenharmony_ci * @throws { BusinessError } 13900045 - Connection failed. 639561847f8eSopenharmony_ci * @throws { BusinessError } 13900046 - Software caused connection abort. 639661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 639761847f8eSopenharmony_ci * @since 12 639861847f8eSopenharmony_ci */ 639961847f8eSopenharmony_cideclare function connectDfs(networkId: string, listeners: DfsListeners): Promise<void>; 640061847f8eSopenharmony_ci 640161847f8eSopenharmony_ci/** 640261847f8eSopenharmony_ci * Disconnect Distributed File System. 640361847f8eSopenharmony_ci * 640461847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 640561847f8eSopenharmony_ci * @param { string } networkId - The networkId of device. 640661847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 640761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 640861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; 640961847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 641061847f8eSopenharmony_ci * @throws { BusinessError } 13600004 - Unmount failed. 641161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 641261847f8eSopenharmony_ci * @since 12 641361847f8eSopenharmony_ci */ 641461847f8eSopenharmony_cideclare function disconnectDfs(networkId: string): Promise<void>; 641561847f8eSopenharmony_ci 641661847f8eSopenharmony_ci/** 641761847f8eSopenharmony_ci * Set extended attributes information of the file. 641861847f8eSopenharmony_ci * 641961847f8eSopenharmony_ci * @param { string } path - path. 642061847f8eSopenharmony_ci * @param { string } key - the key of extended attribute. 642161847f8eSopenharmony_ci * @param { string } value - the value of extended attribute. 642261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 642361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 642461847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 642561847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 642661847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 642761847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 642861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 642961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 643061847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 643161847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 643261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 643361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 643461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 643561847f8eSopenharmony_ci * @since 12 643661847f8eSopenharmony_ci */ 643761847f8eSopenharmony_cideclare function setxattr(path: string, key: string, value: string): Promise<void>; 643861847f8eSopenharmony_ci 643961847f8eSopenharmony_ci/** 644061847f8eSopenharmony_ci * Set extended attributes information of the file. 644161847f8eSopenharmony_ci * 644261847f8eSopenharmony_ci * @param { string } path - path. 644361847f8eSopenharmony_ci * @param { string } key - the key of extended attribute. 644461847f8eSopenharmony_ci * @param { string } value - the value of extended attribute. 644561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 644661847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 644761847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 644861847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 644961847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 645061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 645161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 645261847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 645361847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 645461847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 645561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 645661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 645761847f8eSopenharmony_ci * @since 12 645861847f8eSopenharmony_ci */ 645961847f8eSopenharmony_ci 646061847f8eSopenharmony_cideclare function setxattrSync(path: string, key: string, value: string): void; 646161847f8eSopenharmony_ci 646261847f8eSopenharmony_ci/** 646361847f8eSopenharmony_ci * Get extended attributes information of the file. 646461847f8eSopenharmony_ci * 646561847f8eSopenharmony_ci * @param { string } path - path. 646661847f8eSopenharmony_ci * @param { string } key - the key of extended attribute. 646761847f8eSopenharmony_ci * @returns { Promise<string> } The promise returned by the function. 646861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 646961847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 647061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 647161847f8eSopenharmony_ci * @throws { BusinessError } 13900007 - Arg list too long 647261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 647361847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 647461847f8eSopenharmony_ci * @throws { BusinessError } 13900037 - No data available 647561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 647661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 647761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 647861847f8eSopenharmony_ci * @since 12 647961847f8eSopenharmony_ci */ 648061847f8eSopenharmony_cideclare function getxattr(path: string, key: string): Promise<string>; 648161847f8eSopenharmony_ci 648261847f8eSopenharmony_ci/** 648361847f8eSopenharmony_ci * Get extended attributes information of the file with sync interface. 648461847f8eSopenharmony_ci * 648561847f8eSopenharmony_ci * @param { string } path - path. 648661847f8eSopenharmony_ci * @param { string } key - the key of extended attribute. 648761847f8eSopenharmony_ci * @returns { string } Return the value of extended attribute. 648861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 648961847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 649061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 649161847f8eSopenharmony_ci * @throws { BusinessError } 13900007 - Arg list too long 649261847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 649361847f8eSopenharmony_ci * @throws { BusinessError } 13900031 - Function not implemented 649461847f8eSopenharmony_ci * @throws { BusinessError } 13900037 - No data available 649561847f8eSopenharmony_ci * @throws { BusinessError } 13900038 - Value too large for defined data type 649661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 649761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 649861847f8eSopenharmony_ci * @since 12 649961847f8eSopenharmony_ci */ 650061847f8eSopenharmony_cideclare function getxattrSync(path: string, key: string): string; 650161847f8eSopenharmony_ci 650261847f8eSopenharmony_ci/** 650361847f8eSopenharmony_ci * Progress data of copyFile 650461847f8eSopenharmony_ci * 650561847f8eSopenharmony_ci * @typedef Progress 650661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 650761847f8eSopenharmony_ci * @since 11 650861847f8eSopenharmony_ci */ 650961847f8eSopenharmony_ciinterface Progress { 651061847f8eSopenharmony_ci /** 651161847f8eSopenharmony_ci * @type { number } 651261847f8eSopenharmony_ci * @readonly 651361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 651461847f8eSopenharmony_ci * @since 11 651561847f8eSopenharmony_ci */ 651661847f8eSopenharmony_ci readonly processedSize: number; 651761847f8eSopenharmony_ci 651861847f8eSopenharmony_ci /** 651961847f8eSopenharmony_ci * @type { number } 652061847f8eSopenharmony_ci * @readonly 652161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 652261847f8eSopenharmony_ci * @since 11 652361847f8eSopenharmony_ci */ 652461847f8eSopenharmony_ci readonly totalSize: number; 652561847f8eSopenharmony_ci} 652661847f8eSopenharmony_ci 652761847f8eSopenharmony_ci/** 652861847f8eSopenharmony_ci * Task signal. 652961847f8eSopenharmony_ci * 653061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 653161847f8eSopenharmony_ci * @since 12 653261847f8eSopenharmony_ci */ 653361847f8eSopenharmony_ciexport class TaskSignal { 653461847f8eSopenharmony_ci /** 653561847f8eSopenharmony_ci * Cancel the copy task in progress. 653661847f8eSopenharmony_ci * 653761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 653861847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied by the file system 653961847f8eSopenharmony_ci * @throws { BusinessError } 13900043 - No task can be canceled. 654061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 654161847f8eSopenharmony_ci * @since 12 654261847f8eSopenharmony_ci */ 654361847f8eSopenharmony_ci cancel(): void; 654461847f8eSopenharmony_ci 654561847f8eSopenharmony_ci /** 654661847f8eSopenharmony_ci * Subscribe the cancel event of current task. 654761847f8eSopenharmony_ci * 654861847f8eSopenharmony_ci * @returns { Promise<string> } Return the result of the cancel event. 654961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 655061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 655161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 655261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 655361847f8eSopenharmony_ci * @since 12 655461847f8eSopenharmony_ci */ 655561847f8eSopenharmony_ci onCancel(): Promise<string>; 655661847f8eSopenharmony_ci} 655761847f8eSopenharmony_ci 655861847f8eSopenharmony_ci/** 655961847f8eSopenharmony_ci * Get options of copy 656061847f8eSopenharmony_ci * 656161847f8eSopenharmony_ci * @typedef CopyOptions 656261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 656361847f8eSopenharmony_ci * @since 11 656461847f8eSopenharmony_ci */ 656561847f8eSopenharmony_ciinterface CopyOptions { 656661847f8eSopenharmony_ci /** 656761847f8eSopenharmony_ci * Listener of copy progress 656861847f8eSopenharmony_ci * 656961847f8eSopenharmony_ci * @type { ?ProgressListener } 657061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 657161847f8eSopenharmony_ci * @since 11 657261847f8eSopenharmony_ci */ 657361847f8eSopenharmony_ci progressListener?: ProgressListener; 657461847f8eSopenharmony_ci /** 657561847f8eSopenharmony_ci * Cancel signal of copy. 657661847f8eSopenharmony_ci * 657761847f8eSopenharmony_ci * @type { ?TaskSignal } 657861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 657961847f8eSopenharmony_ci * @since 12 658061847f8eSopenharmony_ci */ 658161847f8eSopenharmony_ci copySignal?: TaskSignal; 658261847f8eSopenharmony_ci} 658361847f8eSopenharmony_ci 658461847f8eSopenharmony_ci/** 658561847f8eSopenharmony_ci * Listener of copy progress. 658661847f8eSopenharmony_ci * 658761847f8eSopenharmony_ci * @typedef { function } ProgressListener 658861847f8eSopenharmony_ci * @param { Progress } progress - indicates the progress data of copyFile 658961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 659061847f8eSopenharmony_ci * @since 11 659161847f8eSopenharmony_ci */ 659261847f8eSopenharmony_citype ProgressListener = (progress: Progress) => void; 659361847f8eSopenharmony_ci 659461847f8eSopenharmony_ci/** 659561847f8eSopenharmony_ci * File object. 659661847f8eSopenharmony_ci * 659761847f8eSopenharmony_ci * @interface File 659861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 659961847f8eSopenharmony_ci * @since 9 660061847f8eSopenharmony_ci */ 660161847f8eSopenharmony_ci/** 660261847f8eSopenharmony_ci * File object. 660361847f8eSopenharmony_ci * 660461847f8eSopenharmony_ci * @interface File 660561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 660661847f8eSopenharmony_ci * @crossplatform 660761847f8eSopenharmony_ci * @since 10 660861847f8eSopenharmony_ci */ 660961847f8eSopenharmony_ci/** 661061847f8eSopenharmony_ci * File object. 661161847f8eSopenharmony_ci * 661261847f8eSopenharmony_ci * @interface File 661361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 661461847f8eSopenharmony_ci * @crossplatform 661561847f8eSopenharmony_ci * @atomicservice 661661847f8eSopenharmony_ci * @since 11 661761847f8eSopenharmony_ci */ 661861847f8eSopenharmony_cideclare interface File { 661961847f8eSopenharmony_ci /** 662061847f8eSopenharmony_ci * @type { number } 662161847f8eSopenharmony_ci * @readonly 662261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 662361847f8eSopenharmony_ci * @since 9 662461847f8eSopenharmony_ci */ 662561847f8eSopenharmony_ci /** 662661847f8eSopenharmony_ci * @type { number } 662761847f8eSopenharmony_ci * @readonly 662861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 662961847f8eSopenharmony_ci * @crossplatform 663061847f8eSopenharmony_ci * @since 10 663161847f8eSopenharmony_ci */ 663261847f8eSopenharmony_ci /** 663361847f8eSopenharmony_ci * @type { number } 663461847f8eSopenharmony_ci * @readonly 663561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 663661847f8eSopenharmony_ci * @crossplatform 663761847f8eSopenharmony_ci * @atomicservice 663861847f8eSopenharmony_ci * @since 11 663961847f8eSopenharmony_ci */ 664061847f8eSopenharmony_ci readonly fd: number; 664161847f8eSopenharmony_ci 664261847f8eSopenharmony_ci /** 664361847f8eSopenharmony_ci * File path 664461847f8eSopenharmony_ci * 664561847f8eSopenharmony_ci * @type { string } 664661847f8eSopenharmony_ci * @readonly 664761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 664861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 664961847f8eSopenharmony_ci * @throws { BusinessError } 14300002 - Invalid URI 665061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 665161847f8eSopenharmony_ci * @since 10 665261847f8eSopenharmony_ci */ 665361847f8eSopenharmony_ci readonly path: string; 665461847f8eSopenharmony_ci 665561847f8eSopenharmony_ci /** 665661847f8eSopenharmony_ci * File name 665761847f8eSopenharmony_ci * 665861847f8eSopenharmony_ci * @type { string } 665961847f8eSopenharmony_ci * @readonly 666061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 666161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 666261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 666361847f8eSopenharmony_ci * @since 10 666461847f8eSopenharmony_ci */ 666561847f8eSopenharmony_ci readonly name: string; 666661847f8eSopenharmony_ci 666761847f8eSopenharmony_ci /** 666861847f8eSopenharmony_ci * Get parent path of file. 666961847f8eSopenharmony_ci * 667061847f8eSopenharmony_ci * @returns { string } Return the parent path of file. 667161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 667261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 667361847f8eSopenharmony_ci * @throws { BusinessError } 14300002 - Invalid URI 667461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 667561847f8eSopenharmony_ci * @since 11 667661847f8eSopenharmony_ci */ 667761847f8eSopenharmony_ci getParent(): string; 667861847f8eSopenharmony_ci 667961847f8eSopenharmony_ci /** 668061847f8eSopenharmony_ci * Lock file with blocking method. 668161847f8eSopenharmony_ci * 668261847f8eSopenharmony_ci * @param { boolean } exclusive - whether lock is exclusive. 668361847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 668461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 668561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 668661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 668761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 668861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 668961847f8eSopenharmony_ci * @throws { BusinessError } 13900043 - No record locks available 669061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 669161847f8eSopenharmony_ci * @since 9 669261847f8eSopenharmony_ci */ 669361847f8eSopenharmony_ci lock(exclusive?: boolean): Promise<void>; 669461847f8eSopenharmony_ci 669561847f8eSopenharmony_ci /** 669661847f8eSopenharmony_ci * Lock file with blocking method. 669761847f8eSopenharmony_ci * 669861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 669961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 670061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 670161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 670261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 670361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 670461847f8eSopenharmony_ci * @throws { BusinessError } 13900043 - No record locks available 670561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 670661847f8eSopenharmony_ci * @since 9 670761847f8eSopenharmony_ci */ 670861847f8eSopenharmony_ci lock(callback: AsyncCallback<void>): void; 670961847f8eSopenharmony_ci 671061847f8eSopenharmony_ci /** 671161847f8eSopenharmony_ci * Lock file with blocking method. 671261847f8eSopenharmony_ci * 671361847f8eSopenharmony_ci * @param { boolean } exclusive - whether lock is exclusive. 671461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 671561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 671661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 671761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 671861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 671961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 672061847f8eSopenharmony_ci * @throws { BusinessError } 13900043 - No record locks available 672161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 672261847f8eSopenharmony_ci * @since 9 672361847f8eSopenharmony_ci */ 672461847f8eSopenharmony_ci lock(exclusive: boolean, callback: AsyncCallback<void>): void; 672561847f8eSopenharmony_ci 672661847f8eSopenharmony_ci /** 672761847f8eSopenharmony_ci * Try to lock file with returning results immediately. 672861847f8eSopenharmony_ci * 672961847f8eSopenharmony_ci * @param { boolean } exclusive - whether lock is exclusive. 673061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 673161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 673261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 673361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 673461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 673561847f8eSopenharmony_ci * @throws { BusinessError } 13900043 - No record locks available 673661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 673761847f8eSopenharmony_ci * @since 9 673861847f8eSopenharmony_ci */ 673961847f8eSopenharmony_ci tryLock(exclusive?: boolean): void; 674061847f8eSopenharmony_ci 674161847f8eSopenharmony_ci /** 674261847f8eSopenharmony_ci * Unlock file. 674361847f8eSopenharmony_ci * 674461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 674561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 674661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 674761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 674861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 674961847f8eSopenharmony_ci * @throws { BusinessError } 13900043 - No record locks available 675061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 675161847f8eSopenharmony_ci * @since 9 675261847f8eSopenharmony_ci */ 675361847f8eSopenharmony_ci unlock(): void; 675461847f8eSopenharmony_ci} 675561847f8eSopenharmony_ci 675661847f8eSopenharmony_ci/** 675761847f8eSopenharmony_ci * RandomAccessFile object. 675861847f8eSopenharmony_ci * 675961847f8eSopenharmony_ci * @interface RandomAccessFile 676061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 676161847f8eSopenharmony_ci * @since 10 676261847f8eSopenharmony_ci */ 676361847f8eSopenharmony_cideclare interface RandomAccessFile { 676461847f8eSopenharmony_ci 676561847f8eSopenharmony_ci /** 676661847f8eSopenharmony_ci * File descriptor 676761847f8eSopenharmony_ci * 676861847f8eSopenharmony_ci * @type { number } 676961847f8eSopenharmony_ci * @readonly 677061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 677161847f8eSopenharmony_ci * @since 10 677261847f8eSopenharmony_ci */ 677361847f8eSopenharmony_ci readonly fd: number; 677461847f8eSopenharmony_ci 677561847f8eSopenharmony_ci /** 677661847f8eSopenharmony_ci * File pointer 677761847f8eSopenharmony_ci * 677861847f8eSopenharmony_ci * @type { number } 677961847f8eSopenharmony_ci * @readonly 678061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 678161847f8eSopenharmony_ci * @since 10 678261847f8eSopenharmony_ci */ 678361847f8eSopenharmony_ci readonly filePointer: number; 678461847f8eSopenharmony_ci 678561847f8eSopenharmony_ci /** 678661847f8eSopenharmony_ci * Set file pointer. 678761847f8eSopenharmony_ci * 678861847f8eSopenharmony_ci * @param { number } filePointer - filePointer. 678961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 679061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 679161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 679261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 679361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 679461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 679561847f8eSopenharmony_ci * @since 10 679661847f8eSopenharmony_ci */ 679761847f8eSopenharmony_ci setFilePointer(filePointer: number): void; 679861847f8eSopenharmony_ci 679961847f8eSopenharmony_ci /** 680061847f8eSopenharmony_ci * Close randomAccessFile with sync interface. 680161847f8eSopenharmony_ci * 680261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 680361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 680461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 680561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 680661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 680761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 680861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 680961847f8eSopenharmony_ci * @since 10 681061847f8eSopenharmony_ci */ 681161847f8eSopenharmony_ci close(): void; 681261847f8eSopenharmony_ci 681361847f8eSopenharmony_ci /** 681461847f8eSopenharmony_ci * Write randomAccessFile. 681561847f8eSopenharmony_ci * 681661847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 681761847f8eSopenharmony_ci * @param { object } [options] - options. 681861847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode. 681961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 682061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 682161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 682261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 682361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 682461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 682561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 682661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 682761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 682861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 682961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 683061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 683161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 683261847f8eSopenharmony_ci * @since 10 683361847f8eSopenharmony_ci */ 683461847f8eSopenharmony_ci /** 683561847f8eSopenharmony_ci * Write randomAccessFile. 683661847f8eSopenharmony_ci * 683761847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 683861847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 683961847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode. 684061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 684161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 684261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 684361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 684461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 684561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 684661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 684761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 684861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 684961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 685061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 685161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 685261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 685361847f8eSopenharmony_ci * @since 11 685461847f8eSopenharmony_ci */ 685561847f8eSopenharmony_ci write( 685661847f8eSopenharmony_ci buffer: ArrayBuffer | string, 685761847f8eSopenharmony_ci options?: WriteOptions 685861847f8eSopenharmony_ci ): Promise<number>; 685961847f8eSopenharmony_ci 686061847f8eSopenharmony_ci /** 686161847f8eSopenharmony_ci * Write randomAccessFile. 686261847f8eSopenharmony_ci * 686361847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 686461847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 686561847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 686661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 686761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 686861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 686961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 687061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 687161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 687261847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 687361847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 687461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 687561847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 687661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 687761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 687861847f8eSopenharmony_ci * @since 10 687961847f8eSopenharmony_ci */ 688061847f8eSopenharmony_ci write(buffer: ArrayBuffer | string, callback: AsyncCallback<number>): void; 688161847f8eSopenharmony_ci 688261847f8eSopenharmony_ci /** 688361847f8eSopenharmony_ci * Write randomAccessFile. 688461847f8eSopenharmony_ci * 688561847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 688661847f8eSopenharmony_ci * @param { object } [options] - options. 688761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 688861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 688961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 689061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 689161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 689261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 689361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 689461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 689561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 689661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 689761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 689861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 689961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 690061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 690161847f8eSopenharmony_ci * @since 10 690261847f8eSopenharmony_ci */ 690361847f8eSopenharmony_ci /** 690461847f8eSopenharmony_ci * Write randomAccessFile. 690561847f8eSopenharmony_ci * 690661847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 690761847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 690861847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file. 690961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 691061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 691161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 691261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 691361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 691461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 691561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 691661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 691761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 691861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 691961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 692061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 692161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 692261847f8eSopenharmony_ci * @since 11 692361847f8eSopenharmony_ci */ 692461847f8eSopenharmony_ci write( 692561847f8eSopenharmony_ci buffer: ArrayBuffer | string, 692661847f8eSopenharmony_ci options: WriteOptions, 692761847f8eSopenharmony_ci callback: AsyncCallback<number> 692861847f8eSopenharmony_ci ): void; 692961847f8eSopenharmony_ci 693061847f8eSopenharmony_ci /** 693161847f8eSopenharmony_ci * Write randomAccessFile with sync interface. 693261847f8eSopenharmony_ci * 693361847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 693461847f8eSopenharmony_ci * @param { object } [options] - options. 693561847f8eSopenharmony_ci * @returns { number } Returns the number of bytes written to the file. 693661847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 693761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 693861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 693961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 694061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 694161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 694261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 694361847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 694461847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 694561847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 694661847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 694761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 694861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 694961847f8eSopenharmony_ci * @since 10 695061847f8eSopenharmony_ci */ 695161847f8eSopenharmony_ci /** 695261847f8eSopenharmony_ci * Write randomAccessFile with sync interface. 695361847f8eSopenharmony_ci * 695461847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 695561847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 695661847f8eSopenharmony_ci * @returns { number } Returns the number of bytes written to the file. 695761847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 695861847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 695961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 696061847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 696161847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 696261847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 696361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 696461847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 696561847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 696661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 696761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 696861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 696961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 697061847f8eSopenharmony_ci * @since 11 697161847f8eSopenharmony_ci */ 697261847f8eSopenharmony_ci writeSync( 697361847f8eSopenharmony_ci buffer: ArrayBuffer | string, 697461847f8eSopenharmony_ci options?: WriteOptions 697561847f8eSopenharmony_ci ): number; 697661847f8eSopenharmony_ci 697761847f8eSopenharmony_ci /** 697861847f8eSopenharmony_ci * Read randomAccessFile. 697961847f8eSopenharmony_ci * 698061847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 698161847f8eSopenharmony_ci * @param { object } [options] - options. 698261847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 698361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 698461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 698561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 698661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 698761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 698861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 698961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 699061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 699161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 699261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 699361847f8eSopenharmony_ci * @since 10 699461847f8eSopenharmony_ci */ 699561847f8eSopenharmony_ci /** 699661847f8eSopenharmony_ci * Read randomAccessFile. 699761847f8eSopenharmony_ci * 699861847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 699961847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 700061847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 700161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 700261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 700361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 700461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 700561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 700661847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 700761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 700861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 700961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 701061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 701161847f8eSopenharmony_ci * @since 11 701261847f8eSopenharmony_ci */ 701361847f8eSopenharmony_ci /** 701461847f8eSopenharmony_ci * Read randomAccessFile. 701561847f8eSopenharmony_ci * 701661847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 701761847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 701861847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 701961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 702061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 702161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 702261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 702361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 702461847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 702561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 702661847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 702761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 702861847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 702961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 703061847f8eSopenharmony_ci * @since 12 703161847f8eSopenharmony_ci */ 703261847f8eSopenharmony_ci read( 703361847f8eSopenharmony_ci buffer: ArrayBuffer, 703461847f8eSopenharmony_ci options?: ReadOptions 703561847f8eSopenharmony_ci ): Promise<number>; 703661847f8eSopenharmony_ci 703761847f8eSopenharmony_ci /** 703861847f8eSopenharmony_ci * Read randomAccessFile. 703961847f8eSopenharmony_ci * 704061847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 704161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 704261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 704361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 704461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 704561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 704661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 704761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 704861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 704961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 705061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 705161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 705261847f8eSopenharmony_ci * @since 10 705361847f8eSopenharmony_ci */ 705461847f8eSopenharmony_ci read(buffer: ArrayBuffer, callback: AsyncCallback<number>): void; 705561847f8eSopenharmony_ci 705661847f8eSopenharmony_ci /** 705761847f8eSopenharmony_ci * Read randomAccessFile. 705861847f8eSopenharmony_ci * 705961847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 706061847f8eSopenharmony_ci * @param { object } [options] - options. 706161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 706261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 706361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 706461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 706561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 706661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 706761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 706861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 706961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 707061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 707161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 707261847f8eSopenharmony_ci * @since 10 707361847f8eSopenharmony_ci */ 707461847f8eSopenharmony_ci /** 707561847f8eSopenharmony_ci * Read randomAccessFile. 707661847f8eSopenharmony_ci * 707761847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 707861847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 707961847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 708061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 708161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 708261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 708361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 708461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 708561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 708661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 708761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 708861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 708961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 709061847f8eSopenharmony_ci * @since 11 709161847f8eSopenharmony_ci */ 709261847f8eSopenharmony_ci read( 709361847f8eSopenharmony_ci buffer: ArrayBuffer, 709461847f8eSopenharmony_ci options: ReadOptions, 709561847f8eSopenharmony_ci callback: AsyncCallback<number> 709661847f8eSopenharmony_ci ): void; 709761847f8eSopenharmony_ci 709861847f8eSopenharmony_ci /** 709961847f8eSopenharmony_ci * Read randomAccessFile with sync interface. 710061847f8eSopenharmony_ci * 710161847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 710261847f8eSopenharmony_ci * @param { object } [options] - options. 710361847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to buffer. 710461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 710561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 710661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 710761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 710861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 710961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 711061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 711161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 711261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 711361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 711461847f8eSopenharmony_ci * @since 10 711561847f8eSopenharmony_ci */ 711661847f8eSopenharmony_ci /** 711761847f8eSopenharmony_ci * Read randomAccessFile with sync interface. 711861847f8eSopenharmony_ci * 711961847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 712061847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 712161847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to buffer. 712261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 712361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 712461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 712561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 712661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 712761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 712861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 712961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 713061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 713161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 713261847f8eSopenharmony_ci * @since 11 713361847f8eSopenharmony_ci */ 713461847f8eSopenharmony_ci /** 713561847f8eSopenharmony_ci * Read randomAccessFile with sync interface. 713661847f8eSopenharmony_ci * 713761847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 713861847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 713961847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to buffer. 714061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 714161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 714261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 714361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 714461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 714561847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 714661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 714761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 714861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 714961847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 715061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 715161847f8eSopenharmony_ci * @since 12 715261847f8eSopenharmony_ci */ 715361847f8eSopenharmony_ci readSync( 715461847f8eSopenharmony_ci buffer: ArrayBuffer, 715561847f8eSopenharmony_ci options?: ReadOptions 715661847f8eSopenharmony_ci ): number; 715761847f8eSopenharmony_ci 715861847f8eSopenharmony_ci /** 715961847f8eSopenharmony_ci * Generate read stream from RandomAccessFile object. 716061847f8eSopenharmony_ci * 716161847f8eSopenharmony_ci * @returns { ReadStream } Return ReadStream object. 716261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error 716361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 716461847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 716561847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 716661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 716761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 716861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 716961847f8eSopenharmony_ci * @since 12 717061847f8eSopenharmony_ci */ 717161847f8eSopenharmony_ci getReadStream(): ReadStream; 717261847f8eSopenharmony_ci 717361847f8eSopenharmony_ci /** 717461847f8eSopenharmony_ci * Generate write stream from RandomAccessFile object. 717561847f8eSopenharmony_ci * 717661847f8eSopenharmony_ci * @returns { WriteStream } Return WriteStream object. 717761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error 717861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 717961847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 718061847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 718161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 718261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 718361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 718461847f8eSopenharmony_ci * @since 12 718561847f8eSopenharmony_ci */ 718661847f8eSopenharmony_ci getWriteStream(): WriteStream; 718761847f8eSopenharmony_ci} 718861847f8eSopenharmony_ci 718961847f8eSopenharmony_ci/** 719061847f8eSopenharmony_ci * File Read Stream. 719161847f8eSopenharmony_ci * 719261847f8eSopenharmony_ci * @extends stream.Readable 719361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 719461847f8eSopenharmony_ci * @since 12 719561847f8eSopenharmony_ci */ 719661847f8eSopenharmony_cideclare class ReadStream extends stream.Readable { 719761847f8eSopenharmony_ci /** 719861847f8eSopenharmony_ci * The ReadStream constructor. 719961847f8eSopenharmony_ci * 720061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 720161847f8eSopenharmony_ci * @since 12 720261847f8eSopenharmony_ci */ 720361847f8eSopenharmony_ci constructor(); 720461847f8eSopenharmony_ci 720561847f8eSopenharmony_ci /** 720661847f8eSopenharmony_ci * The Number of bytes read in the stream. 720761847f8eSopenharmony_ci * 720861847f8eSopenharmony_ci * @type { number } 720961847f8eSopenharmony_ci * @readonly 721061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 721161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 721261847f8eSopenharmony_ci * @since 12 721361847f8eSopenharmony_ci */ 721461847f8eSopenharmony_ci readonly bytesRead: number; 721561847f8eSopenharmony_ci 721661847f8eSopenharmony_ci /** 721761847f8eSopenharmony_ci * The path of the file being read. 721861847f8eSopenharmony_ci * 721961847f8eSopenharmony_ci * @type { string } 722061847f8eSopenharmony_ci * @readonly 722161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 722261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 722361847f8eSopenharmony_ci * @since 12 722461847f8eSopenharmony_ci */ 722561847f8eSopenharmony_ci readonly path: string; 722661847f8eSopenharmony_ci 722761847f8eSopenharmony_ci /** 722861847f8eSopenharmony_ci * Set the file position indicator for the read stream. 722961847f8eSopenharmony_ci * 723061847f8eSopenharmony_ci * @param { number } offset - file offset. 723161847f8eSopenharmony_ci * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. 723261847f8eSopenharmony_ci * @returns { number } Returns the offset relative to starting position of stream. 723361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error 723461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 723561847f8eSopenharmony_ci * @throws { BusinessError } 13900026 - Illegal seek 723661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 723761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 723861847f8eSopenharmony_ci * @since 12 723961847f8eSopenharmony_ci */ 724061847f8eSopenharmony_ci seek(offset: number, whence?: WhenceType): number; 724161847f8eSopenharmony_ci 724261847f8eSopenharmony_ci /** 724361847f8eSopenharmony_ci * Close ReadStream with sync interface. 724461847f8eSopenharmony_ci * 724561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 724661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 724761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 724861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 724961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 725061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 725161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 725261847f8eSopenharmony_ci * @since 12 725361847f8eSopenharmony_ci */ 725461847f8eSopenharmony_ci close(): void; 725561847f8eSopenharmony_ci} 725661847f8eSopenharmony_ci 725761847f8eSopenharmony_ci/** 725861847f8eSopenharmony_ci * File Write Stream. 725961847f8eSopenharmony_ci * 726061847f8eSopenharmony_ci * @extends stream.Writable 726161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 726261847f8eSopenharmony_ci * @since 12 726361847f8eSopenharmony_ci */ 726461847f8eSopenharmony_cideclare class WriteStream extends stream.Writable { 726561847f8eSopenharmony_ci /** 726661847f8eSopenharmony_ci * The WriteStream constructor. 726761847f8eSopenharmony_ci * 726861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 726961847f8eSopenharmony_ci * @since 12 727061847f8eSopenharmony_ci */ 727161847f8eSopenharmony_ci constructor(); 727261847f8eSopenharmony_ci 727361847f8eSopenharmony_ci /** 727461847f8eSopenharmony_ci * The Number of bytes written in the stream. 727561847f8eSopenharmony_ci * 727661847f8eSopenharmony_ci * @type { number } 727761847f8eSopenharmony_ci * @readonly 727861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 727961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 728061847f8eSopenharmony_ci * @since 12 728161847f8eSopenharmony_ci */ 728261847f8eSopenharmony_ci readonly bytesWritten: number; 728361847f8eSopenharmony_ci 728461847f8eSopenharmony_ci /** 728561847f8eSopenharmony_ci * The path of the file being written. 728661847f8eSopenharmony_ci * 728761847f8eSopenharmony_ci * @type { string } 728861847f8eSopenharmony_ci * @readonly 728961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 729061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 729161847f8eSopenharmony_ci * @since 12 729261847f8eSopenharmony_ci */ 729361847f8eSopenharmony_ci readonly path: string; 729461847f8eSopenharmony_ci 729561847f8eSopenharmony_ci /** 729661847f8eSopenharmony_ci * Set the file position indicator for the write stream. 729761847f8eSopenharmony_ci * 729861847f8eSopenharmony_ci * @param { number } offset - file offset. 729961847f8eSopenharmony_ci * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence. 730061847f8eSopenharmony_ci * @returns { number } Returns the offset relative to starting position of stream. 730161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error 730261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 730361847f8eSopenharmony_ci * @throws { BusinessError } 13900026 - Illegal seek 730461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 730561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 730661847f8eSopenharmony_ci * @since 12 730761847f8eSopenharmony_ci */ 730861847f8eSopenharmony_ci seek(offset: number, whence?: WhenceType): number; 730961847f8eSopenharmony_ci 731061847f8eSopenharmony_ci /** 731161847f8eSopenharmony_ci * Close WriteStream with sync interface. 731261847f8eSopenharmony_ci * 731361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 731461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 731561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 731661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 731761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 731861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 731961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 732061847f8eSopenharmony_ci * @since 12 732161847f8eSopenharmony_ci */ 732261847f8eSopenharmony_ci close(): void; 732361847f8eSopenharmony_ci} 732461847f8eSopenharmony_ci 732561847f8eSopenharmony_ci/** 732661847f8eSopenharmony_ci * Stat object. 732761847f8eSopenharmony_ci * 732861847f8eSopenharmony_ci * @interface Stat 732961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 733061847f8eSopenharmony_ci * @since 9 733161847f8eSopenharmony_ci */ 733261847f8eSopenharmony_ci/** 733361847f8eSopenharmony_ci * Stat object. 733461847f8eSopenharmony_ci * 733561847f8eSopenharmony_ci * @interface Stat 733661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 733761847f8eSopenharmony_ci * @crossplatform 733861847f8eSopenharmony_ci * @since 10 733961847f8eSopenharmony_ci */ 734061847f8eSopenharmony_ci/** 734161847f8eSopenharmony_ci * Stat object. 734261847f8eSopenharmony_ci * 734361847f8eSopenharmony_ci * @interface Stat 734461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 734561847f8eSopenharmony_ci * @crossplatform 734661847f8eSopenharmony_ci * @atomicservice 734761847f8eSopenharmony_ci * @since 11 734861847f8eSopenharmony_ci */ 734961847f8eSopenharmony_cideclare interface Stat { 735061847f8eSopenharmony_ci /** 735161847f8eSopenharmony_ci * @type { bigint } 735261847f8eSopenharmony_ci * @readonly 735361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 735461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 735561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 735661847f8eSopenharmony_ci * @since 9 735761847f8eSopenharmony_ci */ 735861847f8eSopenharmony_ci /** 735961847f8eSopenharmony_ci * @type { bigint } 736061847f8eSopenharmony_ci * @readonly 736161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 736261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 736361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 736461847f8eSopenharmony_ci * @crossplatform 736561847f8eSopenharmony_ci * @since 10 736661847f8eSopenharmony_ci */ 736761847f8eSopenharmony_ci readonly ino: bigint; 736861847f8eSopenharmony_ci /** 736961847f8eSopenharmony_ci * @type { number } 737061847f8eSopenharmony_ci * @readonly 737161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 737261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 737361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 737461847f8eSopenharmony_ci * @since 9 737561847f8eSopenharmony_ci */ 737661847f8eSopenharmony_ci /** 737761847f8eSopenharmony_ci * @type { number } 737861847f8eSopenharmony_ci * @readonly 737961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 738061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 738161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 738261847f8eSopenharmony_ci * @crossplatform 738361847f8eSopenharmony_ci * @since 10 738461847f8eSopenharmony_ci */ 738561847f8eSopenharmony_ci /** 738661847f8eSopenharmony_ci * @type { number } 738761847f8eSopenharmony_ci * @readonly 738861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 738961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 739061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 739161847f8eSopenharmony_ci * @crossplatform 739261847f8eSopenharmony_ci * @atomicservice 739361847f8eSopenharmony_ci * @since 11 739461847f8eSopenharmony_ci */ 739561847f8eSopenharmony_ci readonly mode: number; 739661847f8eSopenharmony_ci /** 739761847f8eSopenharmony_ci * @type { number } 739861847f8eSopenharmony_ci * @readonly 739961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 740061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 740161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 740261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 740361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 740461847f8eSopenharmony_ci * @since 9 740561847f8eSopenharmony_ci */ 740661847f8eSopenharmony_ci /** 740761847f8eSopenharmony_ci * @type { number } 740861847f8eSopenharmony_ci * @readonly 740961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 741061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 741161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 741261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 741361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 741461847f8eSopenharmony_ci * @crossplatform 741561847f8eSopenharmony_ci * @since 10 741661847f8eSopenharmony_ci */ 741761847f8eSopenharmony_ci readonly uid: number; 741861847f8eSopenharmony_ci /** 741961847f8eSopenharmony_ci * @type { number } 742061847f8eSopenharmony_ci * @readonly 742161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 742261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 742361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 742461847f8eSopenharmony_ci * @since 9 742561847f8eSopenharmony_ci */ 742661847f8eSopenharmony_ci /** 742761847f8eSopenharmony_ci * @type { number } 742861847f8eSopenharmony_ci * @readonly 742961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 743061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 743161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 743261847f8eSopenharmony_ci * @crossplatform 743361847f8eSopenharmony_ci * @since 10 743461847f8eSopenharmony_ci */ 743561847f8eSopenharmony_ci readonly gid: number; 743661847f8eSopenharmony_ci /** 743761847f8eSopenharmony_ci * @type { number } 743861847f8eSopenharmony_ci * @readonly 743961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 744061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 744161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 744261847f8eSopenharmony_ci * @since 9 744361847f8eSopenharmony_ci */ 744461847f8eSopenharmony_ci /** 744561847f8eSopenharmony_ci * @type { number } 744661847f8eSopenharmony_ci * @readonly 744761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 744861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 744961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 745061847f8eSopenharmony_ci * @crossplatform 745161847f8eSopenharmony_ci * @since 10 745261847f8eSopenharmony_ci */ 745361847f8eSopenharmony_ci /** 745461847f8eSopenharmony_ci * @type { number } 745561847f8eSopenharmony_ci * @readonly 745661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 745761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 745861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 745961847f8eSopenharmony_ci * @crossplatform 746061847f8eSopenharmony_ci * @atomicservice 746161847f8eSopenharmony_ci * @since 11 746261847f8eSopenharmony_ci */ 746361847f8eSopenharmony_ci readonly size: number; 746461847f8eSopenharmony_ci /** 746561847f8eSopenharmony_ci * @type { number } 746661847f8eSopenharmony_ci * @readonly 746761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 746861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 746961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 747061847f8eSopenharmony_ci * @since 9 747161847f8eSopenharmony_ci */ 747261847f8eSopenharmony_ci /** 747361847f8eSopenharmony_ci * @type { number } 747461847f8eSopenharmony_ci * @readonly 747561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 747661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 747761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 747861847f8eSopenharmony_ci * @crossplatform 747961847f8eSopenharmony_ci * @since 10 748061847f8eSopenharmony_ci */ 748161847f8eSopenharmony_ci /** 748261847f8eSopenharmony_ci * @type { number } 748361847f8eSopenharmony_ci * @readonly 748461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 748561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 748661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 748761847f8eSopenharmony_ci * @crossplatform 748861847f8eSopenharmony_ci * @atomicservice 748961847f8eSopenharmony_ci * @since 11 749061847f8eSopenharmony_ci */ 749161847f8eSopenharmony_ci readonly atime: number; 749261847f8eSopenharmony_ci /** 749361847f8eSopenharmony_ci * @type { number } 749461847f8eSopenharmony_ci * @readonly 749561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 749661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 749761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 749861847f8eSopenharmony_ci * @since 9 749961847f8eSopenharmony_ci */ 750061847f8eSopenharmony_ci /** 750161847f8eSopenharmony_ci * @type { number } 750261847f8eSopenharmony_ci * @readonly 750361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 750461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 750561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 750661847f8eSopenharmony_ci * @crossplatform 750761847f8eSopenharmony_ci * @since 10 750861847f8eSopenharmony_ci */ 750961847f8eSopenharmony_ci /** 751061847f8eSopenharmony_ci * @type { number } 751161847f8eSopenharmony_ci * @readonly 751261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 751361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 751461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 751561847f8eSopenharmony_ci * @crossplatform 751661847f8eSopenharmony_ci * @atomicservice 751761847f8eSopenharmony_ci * @since 11 751861847f8eSopenharmony_ci */ 751961847f8eSopenharmony_ci readonly mtime: number; 752061847f8eSopenharmony_ci /** 752161847f8eSopenharmony_ci * @type { number } 752261847f8eSopenharmony_ci * @readonly 752361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 752461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 752561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 752661847f8eSopenharmony_ci * @since 9 752761847f8eSopenharmony_ci */ 752861847f8eSopenharmony_ci /** 752961847f8eSopenharmony_ci * @type { number } 753061847f8eSopenharmony_ci * @readonly 753161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 753261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 753361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 753461847f8eSopenharmony_ci * @crossplatform 753561847f8eSopenharmony_ci * @since 10 753661847f8eSopenharmony_ci */ 753761847f8eSopenharmony_ci readonly ctime: number; 753861847f8eSopenharmony_ci /** 753961847f8eSopenharmony_ci * 754061847f8eSopenharmony_ci * @type { LocationType } 754161847f8eSopenharmony_ci * @readonly 754261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 754361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 754461847f8eSopenharmony_ci * @since 11 754561847f8eSopenharmony_ci */ 754661847f8eSopenharmony_ci readonly location: LocationType; 754761847f8eSopenharmony_ci 754861847f8eSopenharmony_ci /** 754961847f8eSopenharmony_ci * Whether path/fd is block device. 755061847f8eSopenharmony_ci * 755161847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a block device or not. 755261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 755361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 755461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 755561847f8eSopenharmony_ci * @since 9 755661847f8eSopenharmony_ci */ 755761847f8eSopenharmony_ci /** 755861847f8eSopenharmony_ci * Whether path/fd is block device. 755961847f8eSopenharmony_ci * 756061847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a block device or not. 756161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 756261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 756361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 756461847f8eSopenharmony_ci * @crossplatform 756561847f8eSopenharmony_ci * @since 10 756661847f8eSopenharmony_ci */ 756761847f8eSopenharmony_ci isBlockDevice(): boolean; 756861847f8eSopenharmony_ci /** 756961847f8eSopenharmony_ci * Whether path/fd is character device. 757061847f8eSopenharmony_ci * 757161847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a character device or not. 757261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 757361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 757461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 757561847f8eSopenharmony_ci * @since 9 757661847f8eSopenharmony_ci */ 757761847f8eSopenharmony_ci /** 757861847f8eSopenharmony_ci * Whether path/fd is character device. 757961847f8eSopenharmony_ci * 758061847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a character device or not. 758161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 758261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 758361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 758461847f8eSopenharmony_ci * @crossplatform 758561847f8eSopenharmony_ci * @since 10 758661847f8eSopenharmony_ci */ 758761847f8eSopenharmony_ci isCharacterDevice(): boolean; 758861847f8eSopenharmony_ci /** 758961847f8eSopenharmony_ci * Whether path/fd is directory. 759061847f8eSopenharmony_ci * 759161847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a directory or not. 759261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 759361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 759461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 759561847f8eSopenharmony_ci * @since 9 759661847f8eSopenharmony_ci */ 759761847f8eSopenharmony_ci /** 759861847f8eSopenharmony_ci * Whether path/fd is directory. 759961847f8eSopenharmony_ci * 760061847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a directory or not. 760161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 760261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 760361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 760461847f8eSopenharmony_ci * @crossplatform 760561847f8eSopenharmony_ci * @since 10 760661847f8eSopenharmony_ci */ 760761847f8eSopenharmony_ci /** 760861847f8eSopenharmony_ci * Whether path/fd is directory. 760961847f8eSopenharmony_ci * 761061847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a directory or not. 761161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 761261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 761361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 761461847f8eSopenharmony_ci * @crossplatform 761561847f8eSopenharmony_ci * @atomicservice 761661847f8eSopenharmony_ci * @since 11 761761847f8eSopenharmony_ci */ 761861847f8eSopenharmony_ci isDirectory(): boolean; 761961847f8eSopenharmony_ci /** 762061847f8eSopenharmony_ci * Whether path/fd is fifo. 762161847f8eSopenharmony_ci * 762261847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a fifo file or not. 762361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 762461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 762561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 762661847f8eSopenharmony_ci * @since 9 762761847f8eSopenharmony_ci */ 762861847f8eSopenharmony_ci /** 762961847f8eSopenharmony_ci * Whether path/fd is fifo. 763061847f8eSopenharmony_ci * 763161847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a fifo file or not. 763261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 763361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 763461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 763561847f8eSopenharmony_ci * @crossplatform 763661847f8eSopenharmony_ci * @since 10 763761847f8eSopenharmony_ci */ 763861847f8eSopenharmony_ci isFIFO(): boolean; 763961847f8eSopenharmony_ci /** 764061847f8eSopenharmony_ci * Whether path/fd is file. 764161847f8eSopenharmony_ci * 764261847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a normal file or not. 764361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 764461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 764561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 764661847f8eSopenharmony_ci * @since 9 764761847f8eSopenharmony_ci */ 764861847f8eSopenharmony_ci /** 764961847f8eSopenharmony_ci * Whether path/fd is file. 765061847f8eSopenharmony_ci * 765161847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a normal file or not. 765261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 765361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 765461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 765561847f8eSopenharmony_ci * @crossplatform 765661847f8eSopenharmony_ci * @since 10 765761847f8eSopenharmony_ci */ 765861847f8eSopenharmony_ci /** 765961847f8eSopenharmony_ci * Whether path/fd is file. 766061847f8eSopenharmony_ci * 766161847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a normal file or not. 766261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 766361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 766461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 766561847f8eSopenharmony_ci * @crossplatform 766661847f8eSopenharmony_ci * @atomicservice 766761847f8eSopenharmony_ci * @since 11 766861847f8eSopenharmony_ci */ 766961847f8eSopenharmony_ci isFile(): boolean; 767061847f8eSopenharmony_ci /** 767161847f8eSopenharmony_ci * Whether path/fd is socket. 767261847f8eSopenharmony_ci * 767361847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a socket file or not. 767461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 767561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 767661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 767761847f8eSopenharmony_ci * @since 9 767861847f8eSopenharmony_ci */ 767961847f8eSopenharmony_ci /** 768061847f8eSopenharmony_ci * Whether path/fd is socket. 768161847f8eSopenharmony_ci * 768261847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a socket file or not. 768361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 768461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 768561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 768661847f8eSopenharmony_ci * @crossplatform 768761847f8eSopenharmony_ci * @since 10 768861847f8eSopenharmony_ci */ 768961847f8eSopenharmony_ci isSocket(): boolean; 769061847f8eSopenharmony_ci /** 769161847f8eSopenharmony_ci * Whether path/fd is symbolic link. 769261847f8eSopenharmony_ci * 769361847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a symbolic link or not. 769461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 769561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 769661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 769761847f8eSopenharmony_ci * @since 9 769861847f8eSopenharmony_ci */ 769961847f8eSopenharmony_ci /** 770061847f8eSopenharmony_ci * Whether path/fd is symbolic link. 770161847f8eSopenharmony_ci * 770261847f8eSopenharmony_ci * @returns { boolean } Returns whether the path/fd point to a symbolic link or not. 770361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 770461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 770561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 770661847f8eSopenharmony_ci * @crossplatform 770761847f8eSopenharmony_ci * @since 10 770861847f8eSopenharmony_ci */ 770961847f8eSopenharmony_ci isSymbolicLink(): boolean; 771061847f8eSopenharmony_ci} 771161847f8eSopenharmony_ci 771261847f8eSopenharmony_ci/** 771361847f8eSopenharmony_ci * Stream object 771461847f8eSopenharmony_ci * 771561847f8eSopenharmony_ci * @interface Stream 771661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 771761847f8eSopenharmony_ci * @since 9 771861847f8eSopenharmony_ci */ 771961847f8eSopenharmony_cideclare interface Stream { 772061847f8eSopenharmony_ci /** 772161847f8eSopenharmony_ci * Close stream. 772261847f8eSopenharmony_ci * 772361847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 772461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 772561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 772661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 772761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 772861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 772961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 773061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 773161847f8eSopenharmony_ci * @since 9 773261847f8eSopenharmony_ci */ 773361847f8eSopenharmony_ci close(): Promise<void>; 773461847f8eSopenharmony_ci 773561847f8eSopenharmony_ci /** 773661847f8eSopenharmony_ci * Close stream. 773761847f8eSopenharmony_ci * 773861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 773961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 774061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 774161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 774261847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 774361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 774461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 774561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 774661847f8eSopenharmony_ci * @since 9 774761847f8eSopenharmony_ci */ 774861847f8eSopenharmony_ci close(callback: AsyncCallback<void>): void; 774961847f8eSopenharmony_ci 775061847f8eSopenharmony_ci /** 775161847f8eSopenharmony_ci * Close stream with sync interface. 775261847f8eSopenharmony_ci * 775361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 775461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 775561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 775661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 775761847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 775861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 775961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 776061847f8eSopenharmony_ci * @since 9 776161847f8eSopenharmony_ci */ 776261847f8eSopenharmony_ci closeSync(): void; 776361847f8eSopenharmony_ci 776461847f8eSopenharmony_ci /** 776561847f8eSopenharmony_ci * Flush stream. 776661847f8eSopenharmony_ci * 776761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 776861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 776961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 777061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 777161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 777261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 777361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 777461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 777561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 777661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 777761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 777861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 777961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 778061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 778161847f8eSopenharmony_ci * @since 9 778261847f8eSopenharmony_ci */ 778361847f8eSopenharmony_ci flush(): Promise<void>; 778461847f8eSopenharmony_ci 778561847f8eSopenharmony_ci /** 778661847f8eSopenharmony_ci * Flush stream. 778761847f8eSopenharmony_ci * 778861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Return the callback function. 778961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 779061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 779161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 779261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 779361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 779461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 779561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 779661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 779761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 779861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 779961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 780061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 780161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 780261847f8eSopenharmony_ci * @since 9 780361847f8eSopenharmony_ci */ 780461847f8eSopenharmony_ci flush(callback: AsyncCallback<void>): void; 780561847f8eSopenharmony_ci 780661847f8eSopenharmony_ci /** 780761847f8eSopenharmony_ci * Flush stream with sync interface. 780861847f8eSopenharmony_ci * 780961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 781061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 781161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 781261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 781361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 781461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 781561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 781661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 781761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 781861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 781961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 782061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 782161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 782261847f8eSopenharmony_ci * @since 9 782361847f8eSopenharmony_ci */ 782461847f8eSopenharmony_ci flushSync(): void; 782561847f8eSopenharmony_ci 782661847f8eSopenharmony_ci /** 782761847f8eSopenharmony_ci * Write stream. 782861847f8eSopenharmony_ci * 782961847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 783061847f8eSopenharmony_ci * @param { object } [options] - options. 783161847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes written to file in promise mode. 783261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 783361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 783461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 783561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 783661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 783761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 783861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 783961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 784061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 784161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 784261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 784361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 784461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 784561847f8eSopenharmony_ci * @since 9 784661847f8eSopenharmony_ci */ 784761847f8eSopenharmony_ci /** 784861847f8eSopenharmony_ci * Write stream. 784961847f8eSopenharmony_ci * 785061847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 785161847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 785261847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes written to file in promise mode. 785361847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 785461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 785561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 785661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 785761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 785861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 785961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 786061847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 786161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 786261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 786361847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 786461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 786561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 786661847f8eSopenharmony_ci * @since 11 786761847f8eSopenharmony_ci */ 786861847f8eSopenharmony_ci write( 786961847f8eSopenharmony_ci buffer: ArrayBuffer | string, 787061847f8eSopenharmony_ci options?: WriteOptions 787161847f8eSopenharmony_ci ): Promise<number>; 787261847f8eSopenharmony_ci 787361847f8eSopenharmony_ci /** 787461847f8eSopenharmony_ci * Write stream. 787561847f8eSopenharmony_ci * 787661847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 787761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes written to file. 787861847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 787961847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 788061847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 788161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 788261847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 788361847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 788461847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 788561847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 788661847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 788761847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 788861847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 788961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 789061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 789161847f8eSopenharmony_ci * @since 9 789261847f8eSopenharmony_ci */ 789361847f8eSopenharmony_ci write(buffer: ArrayBuffer | string, callback: AsyncCallback<number>): void; 789461847f8eSopenharmony_ci 789561847f8eSopenharmony_ci /** 789661847f8eSopenharmony_ci * Write stream. 789761847f8eSopenharmony_ci * 789861847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 789961847f8eSopenharmony_ci * @param { object } [options] - options. 790061847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes written to file. 790161847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 790261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 790361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 790461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 790561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 790661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 790761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 790861847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 790961847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 791061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 791161847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 791261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 791361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 791461847f8eSopenharmony_ci * @since 9 791561847f8eSopenharmony_ci */ 791661847f8eSopenharmony_ci /** 791761847f8eSopenharmony_ci * Write stream. 791861847f8eSopenharmony_ci * 791961847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 792061847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 792161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes written to file. 792261847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 792361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 792461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 792561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 792661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 792761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 792861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 792961847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 793061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 793161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 793261847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 793361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 793461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 793561847f8eSopenharmony_ci * @since 11 793661847f8eSopenharmony_ci */ 793761847f8eSopenharmony_ci write( 793861847f8eSopenharmony_ci buffer: ArrayBuffer | string, 793961847f8eSopenharmony_ci options: WriteOptions, 794061847f8eSopenharmony_ci callback: AsyncCallback<number> 794161847f8eSopenharmony_ci ): void; 794261847f8eSopenharmony_ci 794361847f8eSopenharmony_ci /** 794461847f8eSopenharmony_ci * Write stream with sync interface. 794561847f8eSopenharmony_ci * 794661847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 794761847f8eSopenharmony_ci * @param { object } [options] - options. 794861847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes written to file. 794961847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 795061847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 795161847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 795261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 795361847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 795461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 795561847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 795661847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 795761847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 795861847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 795961847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 796061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 796161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 796261847f8eSopenharmony_ci * @since 9 796361847f8eSopenharmony_ci */ 796461847f8eSopenharmony_ci /** 796561847f8eSopenharmony_ci * Write stream with sync interface. 796661847f8eSopenharmony_ci * 796761847f8eSopenharmony_ci * @param { ArrayBuffer | string } buffer - buffer. 796861847f8eSopenharmony_ci * @param { WriteOptions } [options] - options. 796961847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes written to file. 797061847f8eSopenharmony_ci * @throws { BusinessError } 13900001 - Operation not permitted 797161847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 797261847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 797361847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 797461847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 797561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 797661847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 797761847f8eSopenharmony_ci * @throws { BusinessError } 13900024 - File too large 797861847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 797961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 798061847f8eSopenharmony_ci * @throws { BusinessError } 13900041 - Quota exceeded 798161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 798261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 798361847f8eSopenharmony_ci * @since 11 798461847f8eSopenharmony_ci */ 798561847f8eSopenharmony_ci writeSync( 798661847f8eSopenharmony_ci buffer: ArrayBuffer | string, 798761847f8eSopenharmony_ci options?: WriteOptions 798861847f8eSopenharmony_ci ): number; 798961847f8eSopenharmony_ci 799061847f8eSopenharmony_ci /** 799161847f8eSopenharmony_ci * Read stream. 799261847f8eSopenharmony_ci * 799361847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 799461847f8eSopenharmony_ci * @param { object } [options] - options. 799561847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 799661847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 799761847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 799861847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 799961847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 800061847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 800161847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 800261847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 800361847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 800461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 800561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 800661847f8eSopenharmony_ci * @since 9 800761847f8eSopenharmony_ci */ 800861847f8eSopenharmony_ci /** 800961847f8eSopenharmony_ci * Read stream. 801061847f8eSopenharmony_ci * 801161847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 801261847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 801361847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 801461847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 801561847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 801661847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 801761847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 801861847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 801961847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 802061847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 802161847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 802261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 802361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 802461847f8eSopenharmony_ci * @since 11 802561847f8eSopenharmony_ci */ 802661847f8eSopenharmony_ci /** 802761847f8eSopenharmony_ci * Read stream. 802861847f8eSopenharmony_ci * 802961847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 803061847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 803161847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode. 803261847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 803361847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 803461847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 803561847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 803661847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 803761847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 803861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 803961847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 804061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 804161847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 804261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 804361847f8eSopenharmony_ci * @since 12 804461847f8eSopenharmony_ci */ 804561847f8eSopenharmony_ci read( 804661847f8eSopenharmony_ci buffer: ArrayBuffer, 804761847f8eSopenharmony_ci options?: ReadOptions 804861847f8eSopenharmony_ci ): Promise<number>; 804961847f8eSopenharmony_ci 805061847f8eSopenharmony_ci /** 805161847f8eSopenharmony_ci * Read stream. 805261847f8eSopenharmony_ci * 805361847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 805461847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 805561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 805661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 805761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 805861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 805961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 806061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 806161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 806261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 806361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 806461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 806561847f8eSopenharmony_ci * @since 9 806661847f8eSopenharmony_ci */ 806761847f8eSopenharmony_ci read(buffer: ArrayBuffer, callback: AsyncCallback<number>): void; 806861847f8eSopenharmony_ci 806961847f8eSopenharmony_ci /** 807061847f8eSopenharmony_ci * Read stream. 807161847f8eSopenharmony_ci * 807261847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 807361847f8eSopenharmony_ci * @param { object } [options] - options. 807461847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 807561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 807661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 807761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 807861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 807961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 808061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 808161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 808261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 808361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 808461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 808561847f8eSopenharmony_ci * @since 9 808661847f8eSopenharmony_ci */ 808761847f8eSopenharmony_ci /** 808861847f8eSopenharmony_ci * Read stream. 808961847f8eSopenharmony_ci * 809061847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 809161847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 809261847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer. 809361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 809461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 809561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 809661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 809761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 809861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 809961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 810061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 810161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 810261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 810361847f8eSopenharmony_ci * @since 11 810461847f8eSopenharmony_ci */ 810561847f8eSopenharmony_ci read( 810661847f8eSopenharmony_ci buffer: ArrayBuffer, 810761847f8eSopenharmony_ci options: ReadOptions, 810861847f8eSopenharmony_ci callback: AsyncCallback<number> 810961847f8eSopenharmony_ci ): void; 811061847f8eSopenharmony_ci 811161847f8eSopenharmony_ci /** 811261847f8eSopenharmony_ci * Read stream with sync interface. 811361847f8eSopenharmony_ci * 811461847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 811561847f8eSopenharmony_ci * @param { object } [options] - options. 811661847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to file. 811761847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 811861847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 811961847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 812061847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 812161847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 812261847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 812361847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 812461847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 812561847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 812661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 812761847f8eSopenharmony_ci * @since 9 812861847f8eSopenharmony_ci */ 812961847f8eSopenharmony_ci /** 813061847f8eSopenharmony_ci * Read stream with sync interface. 813161847f8eSopenharmony_ci * 813261847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 813361847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 813461847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to file. 813561847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 813661847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 813761847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 813861847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 813961847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 814061847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 814161847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 814261847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 814361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 814461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 814561847f8eSopenharmony_ci * @since 11 814661847f8eSopenharmony_ci */ 814761847f8eSopenharmony_ci /** 814861847f8eSopenharmony_ci * Read stream with sync interface. 814961847f8eSopenharmony_ci * 815061847f8eSopenharmony_ci * @param { ArrayBuffer } buffer - buffer. 815161847f8eSopenharmony_ci * @param { ReadOptions } [options] - options. 815261847f8eSopenharmony_ci * @returns { number } Returns the number of file bytes read to file. 815361847f8eSopenharmony_ci * @throws { BusinessError } 13900004 - Interrupted system call 815461847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 815561847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 815661847f8eSopenharmony_ci * @throws { BusinessError } 13900010 - Try again 815761847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 815861847f8eSopenharmony_ci * @throws { BusinessError } 13900019 - Is a directory 815961847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 816061847f8eSopenharmony_ci * @throws { BusinessError } 13900034 - Operation would block 816161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 816261847f8eSopenharmony_ci * @throws { BusinessError } 13900044 - Network is unreachable 816361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 816461847f8eSopenharmony_ci * @since 12 816561847f8eSopenharmony_ci */ 816661847f8eSopenharmony_ci readSync( 816761847f8eSopenharmony_ci buffer: ArrayBuffer, 816861847f8eSopenharmony_ci options?: ReadOptions 816961847f8eSopenharmony_ci ): number; 817061847f8eSopenharmony_ci} 817161847f8eSopenharmony_ci 817261847f8eSopenharmony_ci/** 817361847f8eSopenharmony_ci * Implements watcher event listening. 817461847f8eSopenharmony_ci * 817561847f8eSopenharmony_ci * @interface WatchEventListener 817661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 817761847f8eSopenharmony_ci * @since 10 817861847f8eSopenharmony_ci */ 817961847f8eSopenharmony_ciexport interface WatchEventListener { 818061847f8eSopenharmony_ci /** 818161847f8eSopenharmony_ci * Specifies the callback function to be invoked. 818261847f8eSopenharmony_ci * 818361847f8eSopenharmony_ci * @param { WatchEvent } event - Event type for the callback to invoke. 818461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 818561847f8eSopenharmony_ci * @since 10 818661847f8eSopenharmony_ci */ 818761847f8eSopenharmony_ci (event: WatchEvent): void; 818861847f8eSopenharmony_ci} 818961847f8eSopenharmony_ci 819061847f8eSopenharmony_ci/** 819161847f8eSopenharmony_ci * Event Listening. 819261847f8eSopenharmony_ci * 819361847f8eSopenharmony_ci * @interface WatchEvent 819461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 819561847f8eSopenharmony_ci * @since 10 819661847f8eSopenharmony_ci */ 819761847f8eSopenharmony_ciexport interface WatchEvent { 819861847f8eSopenharmony_ci /** 819961847f8eSopenharmony_ci * File name. 820061847f8eSopenharmony_ci * 820161847f8eSopenharmony_ci * @type { string } 820261847f8eSopenharmony_ci * @readonly 820361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 820461847f8eSopenharmony_ci * @since 10 820561847f8eSopenharmony_ci */ 820661847f8eSopenharmony_ci readonly fileName: string; 820761847f8eSopenharmony_ci 820861847f8eSopenharmony_ci /** 820961847f8eSopenharmony_ci * Event happened. 821061847f8eSopenharmony_ci * 821161847f8eSopenharmony_ci * @type { number } 821261847f8eSopenharmony_ci * @readonly 821361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 821461847f8eSopenharmony_ci * @since 10 821561847f8eSopenharmony_ci */ 821661847f8eSopenharmony_ci readonly event: number; 821761847f8eSopenharmony_ci 821861847f8eSopenharmony_ci /** 821961847f8eSopenharmony_ci * Associated rename event. 822061847f8eSopenharmony_ci * 822161847f8eSopenharmony_ci * @type { number } 822261847f8eSopenharmony_ci * @readonly 822361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 822461847f8eSopenharmony_ci * @since 10 822561847f8eSopenharmony_ci */ 822661847f8eSopenharmony_ci readonly cookie: number; 822761847f8eSopenharmony_ci} 822861847f8eSopenharmony_ci 822961847f8eSopenharmony_ci/** 823061847f8eSopenharmony_ci * Watcher object 823161847f8eSopenharmony_ci * 823261847f8eSopenharmony_ci * @interface Watcher 823361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 823461847f8eSopenharmony_ci * @since 10 823561847f8eSopenharmony_ci */ 823661847f8eSopenharmony_ciexport interface Watcher { 823761847f8eSopenharmony_ci /** 823861847f8eSopenharmony_ci * Start watcher. 823961847f8eSopenharmony_ci * 824061847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 824161847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 824261847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 824361847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 824461847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 824561847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 824661847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 824761847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 824861847f8eSopenharmony_ci * @throws { BusinessError } 13900021 - File table overflow 824961847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 825061847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 825161847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 825261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 825361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 825461847f8eSopenharmony_ci * @since 10 825561847f8eSopenharmony_ci */ 825661847f8eSopenharmony_ci start(): void; 825761847f8eSopenharmony_ci 825861847f8eSopenharmony_ci /** 825961847f8eSopenharmony_ci * Stop watcher. 826061847f8eSopenharmony_ci * 826161847f8eSopenharmony_ci * @throws { BusinessError } 13900002 - No such file or directory 826261847f8eSopenharmony_ci * @throws { BusinessError } 13900008 - Bad file descriptor 826361847f8eSopenharmony_ci * @throws { BusinessError } 13900011 - Out of memory 826461847f8eSopenharmony_ci * @throws { BusinessError } 13900012 - Permission denied 826561847f8eSopenharmony_ci * @throws { BusinessError } 13900013 - Bad address 826661847f8eSopenharmony_ci * @throws { BusinessError } 13900015 - File exists 826761847f8eSopenharmony_ci * @throws { BusinessError } 13900018 - Not a directory 826861847f8eSopenharmony_ci * @throws { BusinessError } 13900020 - Invalid argument 826961847f8eSopenharmony_ci * @throws { BusinessError } 13900021 - File table overflow 827061847f8eSopenharmony_ci * @throws { BusinessError } 13900022 - Too many open files 827161847f8eSopenharmony_ci * @throws { BusinessError } 13900025 - No space left on device 827261847f8eSopenharmony_ci * @throws { BusinessError } 13900030 - File name too long 827361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 827461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 827561847f8eSopenharmony_ci * @since 10 827661847f8eSopenharmony_ci */ 827761847f8eSopenharmony_ci stop(): void; 827861847f8eSopenharmony_ci} 827961847f8eSopenharmony_ci 828061847f8eSopenharmony_ci/** 828161847f8eSopenharmony_ci * Reader Iterator Result 828261847f8eSopenharmony_ci * 828361847f8eSopenharmony_ci * @interface ReaderIteratorResult 828461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 828561847f8eSopenharmony_ci * @since 11 828661847f8eSopenharmony_ci */ 828761847f8eSopenharmony_ciexport interface ReaderIteratorResult { 828861847f8eSopenharmony_ci /** 828961847f8eSopenharmony_ci * Whether reader iterator completes the traversal. 829061847f8eSopenharmony_ci * 829161847f8eSopenharmony_ci * @type { boolean } 829261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 829361847f8eSopenharmony_ci * @since 11 829461847f8eSopenharmony_ci */ 829561847f8eSopenharmony_ci done: boolean; 829661847f8eSopenharmony_ci 829761847f8eSopenharmony_ci /** 829861847f8eSopenharmony_ci * The value of reader iterator. 829961847f8eSopenharmony_ci * 830061847f8eSopenharmony_ci * @type { string } 830161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 830261847f8eSopenharmony_ci * @since 11 830361847f8eSopenharmony_ci */ 830461847f8eSopenharmony_ci value: string; 830561847f8eSopenharmony_ci} 830661847f8eSopenharmony_ci 830761847f8eSopenharmony_ci/** 830861847f8eSopenharmony_ci * ReaderIterator object 830961847f8eSopenharmony_ci * 831061847f8eSopenharmony_ci * @interface ReaderIterator 831161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 831261847f8eSopenharmony_ci * @since 11 831361847f8eSopenharmony_ci */ 831461847f8eSopenharmony_cideclare interface ReaderIterator { 831561847f8eSopenharmony_ci /** 831661847f8eSopenharmony_ci * Get next result from the iterator. 831761847f8eSopenharmony_ci * 831861847f8eSopenharmony_ci * @returns { ReaderIteratorResult } Returns the result of reader iterator. 831961847f8eSopenharmony_ci * @throws { BusinessError } 13900005 - I/O error 832061847f8eSopenharmony_ci * @throws { BusinessError } 13900037 - No data available 832161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error 832261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 832361847f8eSopenharmony_ci * @since 11 832461847f8eSopenharmony_ci */ 832561847f8eSopenharmony_ci next(): ReaderIteratorResult; 832661847f8eSopenharmony_ci} 832761847f8eSopenharmony_ci 832861847f8eSopenharmony_ci/** 832961847f8eSopenharmony_ci * File filter type 833061847f8eSopenharmony_ci * 833161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 833261847f8eSopenharmony_ci * @crossplatform 833361847f8eSopenharmony_ci * @since 10 833461847f8eSopenharmony_ci */ 833561847f8eSopenharmony_ci/** 833661847f8eSopenharmony_ci * File filter type 833761847f8eSopenharmony_ci * 833861847f8eSopenharmony_ci * @interface Filter 833961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 834061847f8eSopenharmony_ci * @crossplatform 834161847f8eSopenharmony_ci * @atomicservice 834261847f8eSopenharmony_ci * @since 11 834361847f8eSopenharmony_ci */ 834461847f8eSopenharmony_ciexport interface Filter { 834561847f8eSopenharmony_ci /** 834661847f8eSopenharmony_ci * The suffix of the file. 834761847f8eSopenharmony_ci * 834861847f8eSopenharmony_ci * @type { ?Array<string> } 834961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 835061847f8eSopenharmony_ci * @since 10 835161847f8eSopenharmony_ci */ 835261847f8eSopenharmony_ci /** 835361847f8eSopenharmony_ci * The suffix of the file. 835461847f8eSopenharmony_ci * 835561847f8eSopenharmony_ci * @type { ?Array<string> } 835661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 835761847f8eSopenharmony_ci * @crossplatform 835861847f8eSopenharmony_ci * @atomicservice 835961847f8eSopenharmony_ci * @since 11 836061847f8eSopenharmony_ci */ 836161847f8eSopenharmony_ci suffix?: Array<string>; 836261847f8eSopenharmony_ci /** 836361847f8eSopenharmony_ci * The display name of the file. 836461847f8eSopenharmony_ci * 836561847f8eSopenharmony_ci * @type { ?Array<string> } 836661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 836761847f8eSopenharmony_ci * @since 10 836861847f8eSopenharmony_ci */ 836961847f8eSopenharmony_ci /** 837061847f8eSopenharmony_ci * The display name of the file. 837161847f8eSopenharmony_ci * 837261847f8eSopenharmony_ci * @type { ?Array<string> } 837361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 837461847f8eSopenharmony_ci * @crossplatform 837561847f8eSopenharmony_ci * @atomicservice 837661847f8eSopenharmony_ci * @since 11 837761847f8eSopenharmony_ci */ 837861847f8eSopenharmony_ci displayName?: Array<string>; 837961847f8eSopenharmony_ci /** 838061847f8eSopenharmony_ci * The mimetype of the file. 838161847f8eSopenharmony_ci * 838261847f8eSopenharmony_ci * @type { ?Array<string> } 838361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 838461847f8eSopenharmony_ci * @since 10 838561847f8eSopenharmony_ci */ 838661847f8eSopenharmony_ci /** 838761847f8eSopenharmony_ci * The mimetype of the file. 838861847f8eSopenharmony_ci * 838961847f8eSopenharmony_ci * @type { ?Array<string> } 839061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 839161847f8eSopenharmony_ci * @crossplatform 839261847f8eSopenharmony_ci * @atomicservice 839361847f8eSopenharmony_ci * @since 11 839461847f8eSopenharmony_ci */ 839561847f8eSopenharmony_ci mimeType?: Array<string>; 839661847f8eSopenharmony_ci /** 839761847f8eSopenharmony_ci * The exceeding size of the file. 839861847f8eSopenharmony_ci * 839961847f8eSopenharmony_ci * @type { ?number } 840061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 840161847f8eSopenharmony_ci * @since 10 840261847f8eSopenharmony_ci */ 840361847f8eSopenharmony_ci /** 840461847f8eSopenharmony_ci * The exceeding size of the file. 840561847f8eSopenharmony_ci * 840661847f8eSopenharmony_ci * @type { ?number } 840761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 840861847f8eSopenharmony_ci * @crossplatform 840961847f8eSopenharmony_ci * @atomicservice 841061847f8eSopenharmony_ci * @since 11 841161847f8eSopenharmony_ci */ 841261847f8eSopenharmony_ci fileSizeOver?: number; 841361847f8eSopenharmony_ci /** 841461847f8eSopenharmony_ci * The last modification time of the file. 841561847f8eSopenharmony_ci * 841661847f8eSopenharmony_ci * @type { ?number } 841761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 841861847f8eSopenharmony_ci * @since 10 841961847f8eSopenharmony_ci */ 842061847f8eSopenharmony_ci /** 842161847f8eSopenharmony_ci * The last modification time of the file. 842261847f8eSopenharmony_ci * 842361847f8eSopenharmony_ci * @type { ?number } 842461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 842561847f8eSopenharmony_ci * @crossplatform 842661847f8eSopenharmony_ci * @atomicservice 842761847f8eSopenharmony_ci * @since 11 842861847f8eSopenharmony_ci */ 842961847f8eSopenharmony_ci lastModifiedAfter?: number; 843061847f8eSopenharmony_ci /** 843161847f8eSopenharmony_ci * Whether to exclude media files. 843261847f8eSopenharmony_ci * 843361847f8eSopenharmony_ci * @type { ?boolean } 843461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 843561847f8eSopenharmony_ci * @since 10 843661847f8eSopenharmony_ci */ 843761847f8eSopenharmony_ci /** 843861847f8eSopenharmony_ci * Whether to exclude media files. 843961847f8eSopenharmony_ci * 844061847f8eSopenharmony_ci * @type { ?boolean } 844161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 844261847f8eSopenharmony_ci * @crossplatform 844361847f8eSopenharmony_ci * @atomicservice 844461847f8eSopenharmony_ci * @since 11 844561847f8eSopenharmony_ci */ 844661847f8eSopenharmony_ci excludeMedia?: boolean; 844761847f8eSopenharmony_ci} 844861847f8eSopenharmony_ci 844961847f8eSopenharmony_ci/** 845061847f8eSopenharmony_ci * Conflict Files type 845161847f8eSopenharmony_ci * 845261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 845361847f8eSopenharmony_ci * @since 10 845461847f8eSopenharmony_ci */ 845561847f8eSopenharmony_ci/** 845661847f8eSopenharmony_ci * Conflict Files type 845761847f8eSopenharmony_ci * 845861847f8eSopenharmony_ci * @interface ConflictFiles 845961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 846061847f8eSopenharmony_ci * @since 11 846161847f8eSopenharmony_ci */ 846261847f8eSopenharmony_ciexport interface ConflictFiles { 846361847f8eSopenharmony_ci /** 846461847f8eSopenharmony_ci * The path of the source file. 846561847f8eSopenharmony_ci * 846661847f8eSopenharmony_ci * @type { string } 846761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 846861847f8eSopenharmony_ci * @since 10 846961847f8eSopenharmony_ci */ 847061847f8eSopenharmony_ci /** 847161847f8eSopenharmony_ci * The path of the source file. 847261847f8eSopenharmony_ci * 847361847f8eSopenharmony_ci * @type { string } 847461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 847561847f8eSopenharmony_ci * @since 11 847661847f8eSopenharmony_ci */ 847761847f8eSopenharmony_ci srcFile: string; 847861847f8eSopenharmony_ci 847961847f8eSopenharmony_ci /** 848061847f8eSopenharmony_ci * The path of the source file. 848161847f8eSopenharmony_ci * 848261847f8eSopenharmony_ci * @type { string } 848361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 848461847f8eSopenharmony_ci * @since 10 848561847f8eSopenharmony_ci */ 848661847f8eSopenharmony_ci /** 848761847f8eSopenharmony_ci * The path of the destination file. 848861847f8eSopenharmony_ci * 848961847f8eSopenharmony_ci * @type { string } 849061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 849161847f8eSopenharmony_ci * @since 11 849261847f8eSopenharmony_ci */ 849361847f8eSopenharmony_ci destFile: string; 849461847f8eSopenharmony_ci} 849561847f8eSopenharmony_ci 849661847f8eSopenharmony_ci/** 849761847f8eSopenharmony_ci * Options type 849861847f8eSopenharmony_ci * 849961847f8eSopenharmony_ci * @interface Options 850061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 850161847f8eSopenharmony_ci * @since 11 850261847f8eSopenharmony_ci */ 850361847f8eSopenharmony_ciexport interface Options { 850461847f8eSopenharmony_ci /** 850561847f8eSopenharmony_ci * The encoding style. 850661847f8eSopenharmony_ci * 850761847f8eSopenharmony_ci * @type { ?string } 850861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 850961847f8eSopenharmony_ci * @since 11 851061847f8eSopenharmony_ci */ 851161847f8eSopenharmony_ci encoding?: string; 851261847f8eSopenharmony_ci} 851361847f8eSopenharmony_ci 851461847f8eSopenharmony_ci/** 851561847f8eSopenharmony_ci * ReadOptions type 851661847f8eSopenharmony_ci * 851761847f8eSopenharmony_ci * @interface ReadOptions 851861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 851961847f8eSopenharmony_ci * @atomicservice 852061847f8eSopenharmony_ci * @since 11 852161847f8eSopenharmony_ci */ 852261847f8eSopenharmony_ciexport interface ReadOptions { 852361847f8eSopenharmony_ci /** 852461847f8eSopenharmony_ci * The offset when reading the file. 852561847f8eSopenharmony_ci * 852661847f8eSopenharmony_ci * @type { ?number } 852761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 852861847f8eSopenharmony_ci * @atomicservice 852961847f8eSopenharmony_ci * @since 11 853061847f8eSopenharmony_ci */ 853161847f8eSopenharmony_ci offset?: number; 853261847f8eSopenharmony_ci /** 853361847f8eSopenharmony_ci * The length for reading. 853461847f8eSopenharmony_ci * 853561847f8eSopenharmony_ci * @type { ?number } 853661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 853761847f8eSopenharmony_ci * @atomicservice 853861847f8eSopenharmony_ci * @since 11 853961847f8eSopenharmony_ci */ 854061847f8eSopenharmony_ci length?: number; 854161847f8eSopenharmony_ci} 854261847f8eSopenharmony_ci 854361847f8eSopenharmony_ci/** 854461847f8eSopenharmony_ci * ReadTextOptions type 854561847f8eSopenharmony_ci * 854661847f8eSopenharmony_ci * @interface ReadTextOptions 854761847f8eSopenharmony_ci * @extends ReadOptions 854861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 854961847f8eSopenharmony_ci * @atomicservice 855061847f8eSopenharmony_ci * @since 11 855161847f8eSopenharmony_ci */ 855261847f8eSopenharmony_ciexport interface ReadTextOptions extends ReadOptions { 855361847f8eSopenharmony_ci /** 855461847f8eSopenharmony_ci * The encoding style when reading text. 855561847f8eSopenharmony_ci * 855661847f8eSopenharmony_ci * @type { ?string } 855761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 855861847f8eSopenharmony_ci * @atomicservice 855961847f8eSopenharmony_ci * @since 11 856061847f8eSopenharmony_ci */ 856161847f8eSopenharmony_ci encoding?: string; 856261847f8eSopenharmony_ci} 856361847f8eSopenharmony_ci 856461847f8eSopenharmony_ci/** 856561847f8eSopenharmony_ci * WriteOptions type 856661847f8eSopenharmony_ci * 856761847f8eSopenharmony_ci * @interface WriteOptions 856861847f8eSopenharmony_ci * @extends Options 856961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 857061847f8eSopenharmony_ci * @atomicservice 857161847f8eSopenharmony_ci * @since 11 857261847f8eSopenharmony_ci */ 857361847f8eSopenharmony_ciexport interface WriteOptions extends Options { 857461847f8eSopenharmony_ci /** 857561847f8eSopenharmony_ci * The offset when writing the file. 857661847f8eSopenharmony_ci * 857761847f8eSopenharmony_ci * @type { ?number } 857861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 857961847f8eSopenharmony_ci * @atomicservice 858061847f8eSopenharmony_ci * @since 11 858161847f8eSopenharmony_ci */ 858261847f8eSopenharmony_ci offset?: number; 858361847f8eSopenharmony_ci /** 858461847f8eSopenharmony_ci * The length for writing. 858561847f8eSopenharmony_ci * 858661847f8eSopenharmony_ci * @type { ?number } 858761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 858861847f8eSopenharmony_ci * @atomicservice 858961847f8eSopenharmony_ci * @since 11 859061847f8eSopenharmony_ci */ 859161847f8eSopenharmony_ci length?: number; 859261847f8eSopenharmony_ci} 859361847f8eSopenharmony_ci 859461847f8eSopenharmony_ci/** 859561847f8eSopenharmony_ci * ListFileOptions type 859661847f8eSopenharmony_ci * 859761847f8eSopenharmony_ci * @interface ListFileOptions 859861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 859961847f8eSopenharmony_ci * @atomicservice 860061847f8eSopenharmony_ci * @since 11 860161847f8eSopenharmony_ci */ 860261847f8eSopenharmony_ciexport interface ListFileOptions { 860361847f8eSopenharmony_ci /** 860461847f8eSopenharmony_ci * Whether to recursively list files. 860561847f8eSopenharmony_ci * 860661847f8eSopenharmony_ci * @type { ?boolean } 860761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 860861847f8eSopenharmony_ci * @atomicservice 860961847f8eSopenharmony_ci * @since 11 861061847f8eSopenharmony_ci */ 861161847f8eSopenharmony_ci recursion?: boolean; 861261847f8eSopenharmony_ci 861361847f8eSopenharmony_ci /** 861461847f8eSopenharmony_ci * The number of files listed. 861561847f8eSopenharmony_ci * 861661847f8eSopenharmony_ci * @type { ?number } 861761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 861861847f8eSopenharmony_ci * @atomicservice 861961847f8eSopenharmony_ci * @since 11 862061847f8eSopenharmony_ci */ 862161847f8eSopenharmony_ci listNum?: number; 862261847f8eSopenharmony_ci 862361847f8eSopenharmony_ci /** 862461847f8eSopenharmony_ci * The filter of listing files. 862561847f8eSopenharmony_ci * 862661847f8eSopenharmony_ci * @type { ?Filter } 862761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 862861847f8eSopenharmony_ci * @atomicservice 862961847f8eSopenharmony_ci * @since 11 863061847f8eSopenharmony_ci */ 863161847f8eSopenharmony_ci filter?: Filter; 863261847f8eSopenharmony_ci} 863361847f8eSopenharmony_ci 863461847f8eSopenharmony_ci/** 863561847f8eSopenharmony_ci * RandomAccessFileOptions type 863661847f8eSopenharmony_ci * 863761847f8eSopenharmony_ci * @interface RandomAccessFileOptions 863861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 863961847f8eSopenharmony_ci * @since 12 864061847f8eSopenharmony_ci */ 864161847f8eSopenharmony_ciexport interface RandomAccessFileOptions { 864261847f8eSopenharmony_ci /** 864361847f8eSopenharmony_ci * The starting position of file offset. 864461847f8eSopenharmony_ci * 864561847f8eSopenharmony_ci * @type { ?number } 864661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 864761847f8eSopenharmony_ci * @since 12 864861847f8eSopenharmony_ci */ 864961847f8eSopenharmony_ci start?: number; 865061847f8eSopenharmony_ci 865161847f8eSopenharmony_ci /** 865261847f8eSopenharmony_ci * The ending position of file offset. 865361847f8eSopenharmony_ci * 865461847f8eSopenharmony_ci * @type { ?number } 865561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 865661847f8eSopenharmony_ci * @since 12 865761847f8eSopenharmony_ci */ 865861847f8eSopenharmony_ci end?: number; 865961847f8eSopenharmony_ci} 866061847f8eSopenharmony_ci 866161847f8eSopenharmony_ci/** 866261847f8eSopenharmony_ci * ReadStreamOptions type 866361847f8eSopenharmony_ci * 866461847f8eSopenharmony_ci * @interface ReadStreamOptions 866561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 866661847f8eSopenharmony_ci * @since 12 866761847f8eSopenharmony_ci */ 866861847f8eSopenharmony_ciexport interface ReadStreamOptions { 866961847f8eSopenharmony_ci /** 867061847f8eSopenharmony_ci * The starting range for reading a file by stream. 867161847f8eSopenharmony_ci * 867261847f8eSopenharmony_ci * @type { ?number } 867361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 867461847f8eSopenharmony_ci * @since 12 867561847f8eSopenharmony_ci */ 867661847f8eSopenharmony_ci start?: number; 867761847f8eSopenharmony_ci 867861847f8eSopenharmony_ci /** 867961847f8eSopenharmony_ci * The ending range for reading a file by stream. 868061847f8eSopenharmony_ci * 868161847f8eSopenharmony_ci * @type { ?number } 868261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 868361847f8eSopenharmony_ci * @since 12 868461847f8eSopenharmony_ci */ 868561847f8eSopenharmony_ci end?: number; 868661847f8eSopenharmony_ci} 868761847f8eSopenharmony_ci 868861847f8eSopenharmony_ci/** 868961847f8eSopenharmony_ci * WriteStreamOptions type 869061847f8eSopenharmony_ci * 869161847f8eSopenharmony_ci * @interface WriteStreamOptions 869261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 869361847f8eSopenharmony_ci * @since 12 869461847f8eSopenharmony_ci */ 869561847f8eSopenharmony_ciexport interface WriteStreamOptions { 869661847f8eSopenharmony_ci /** 869761847f8eSopenharmony_ci * The mode for creating write stream. 869861847f8eSopenharmony_ci * 869961847f8eSopenharmony_ci * @type { ?number } 870061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 870161847f8eSopenharmony_ci * @since 12 870261847f8eSopenharmony_ci */ 870361847f8eSopenharmony_ci mode?: number; 870461847f8eSopenharmony_ci /** 870561847f8eSopenharmony_ci * The starting range for writing a file by stream. 870661847f8eSopenharmony_ci * 870761847f8eSopenharmony_ci * @type { ?number } 870861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 870961847f8eSopenharmony_ci * @since 12 871061847f8eSopenharmony_ci */ 871161847f8eSopenharmony_ci start?: number; 871261847f8eSopenharmony_ci} 871361847f8eSopenharmony_ci 871461847f8eSopenharmony_ci/** 871561847f8eSopenharmony_ci * The listeners of Distributed File System. 871661847f8eSopenharmony_ci * 871761847f8eSopenharmony_ci * @typedef DfsListeners 871861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 871961847f8eSopenharmony_ci * @since 12 872061847f8eSopenharmony_ci */ 872161847f8eSopenharmony_ciexport interface DfsListeners { 872261847f8eSopenharmony_ci /** 872361847f8eSopenharmony_ci * The Listener of Distributed File System status 872461847f8eSopenharmony_ci * 872561847f8eSopenharmony_ci * @param { string } networkId - The networkId of device. 872661847f8eSopenharmony_ci * @param { number } status - The status code of Distributed File System. 872761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 872861847f8eSopenharmony_ci * @since 12 872961847f8eSopenharmony_ci */ 873061847f8eSopenharmony_ci onStatus(networkId: string, status: number): void; 873161847f8eSopenharmony_ci} 873261847f8eSopenharmony_ci 873361847f8eSopenharmony_ci/** 873461847f8eSopenharmony_ci * Enumeration of different types of whence. 873561847f8eSopenharmony_ci * 873661847f8eSopenharmony_ci * @enum { number } whence type 873761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 873861847f8eSopenharmony_ci * @since 11 873961847f8eSopenharmony_ci */ 874061847f8eSopenharmony_cideclare enum WhenceType { 874161847f8eSopenharmony_ci /** 874261847f8eSopenharmony_ci * Starting position of the file offset. 874361847f8eSopenharmony_ci * 874461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 874561847f8eSopenharmony_ci * @since 11 874661847f8eSopenharmony_ci */ 874761847f8eSopenharmony_ci SEEK_SET = 0, 874861847f8eSopenharmony_ci 874961847f8eSopenharmony_ci /** 875061847f8eSopenharmony_ci * Current position of the file offset. 875161847f8eSopenharmony_ci * 875261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 875361847f8eSopenharmony_ci * @since 11 875461847f8eSopenharmony_ci */ 875561847f8eSopenharmony_ci SEEK_CUR = 1, 875661847f8eSopenharmony_ci 875761847f8eSopenharmony_ci /** 875861847f8eSopenharmony_ci * Ending position of the file offset. 875961847f8eSopenharmony_ci * 876061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 876161847f8eSopenharmony_ci * @since 11 876261847f8eSopenharmony_ci */ 876361847f8eSopenharmony_ci SEEK_END = 2, 876461847f8eSopenharmony_ci} 876561847f8eSopenharmony_ci 876661847f8eSopenharmony_ci/** 876761847f8eSopenharmony_ci * Enumeration of different types of file location. 876861847f8eSopenharmony_ci * 876961847f8eSopenharmony_ci * @enum { number } location type 877061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 877161847f8eSopenharmony_ci * @since 11 877261847f8eSopenharmony_ci */ 877361847f8eSopenharmony_cideclare enum LocationType { 877461847f8eSopenharmony_ci /** 877561847f8eSopenharmony_ci * Local file. 877661847f8eSopenharmony_ci * 877761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 877861847f8eSopenharmony_ci * @since 11 877961847f8eSopenharmony_ci */ 878061847f8eSopenharmony_ci LOCAL = 1 << 0, 878161847f8eSopenharmony_ci 878261847f8eSopenharmony_ci /** 878361847f8eSopenharmony_ci * Cloud file. 878461847f8eSopenharmony_ci * 878561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 878661847f8eSopenharmony_ci * @since 11 878761847f8eSopenharmony_ci */ 878861847f8eSopenharmony_ci CLOUD = 1 << 1, 878961847f8eSopenharmony_ci} 879061847f8eSopenharmony_ci 879161847f8eSopenharmony_ci/** 879261847f8eSopenharmony_ci * Enumeration of different types of access mode. 879361847f8eSopenharmony_ci * 879461847f8eSopenharmony_ci * @enum { number } access mode type 879561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 879661847f8eSopenharmony_ci * @atomicservice 879761847f8eSopenharmony_ci * @since 12 879861847f8eSopenharmony_ci */ 879961847f8eSopenharmony_cideclare enum AccessModeType { 880061847f8eSopenharmony_ci /** 880161847f8eSopenharmony_ci * Check if the file exists. 880261847f8eSopenharmony_ci * 880361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 880461847f8eSopenharmony_ci * @atomicservice 880561847f8eSopenharmony_ci * @since 12 880661847f8eSopenharmony_ci */ 880761847f8eSopenharmony_ci EXIST = 0, 880861847f8eSopenharmony_ci 880961847f8eSopenharmony_ci /** 881061847f8eSopenharmony_ci * Check if the file has write permission. 881161847f8eSopenharmony_ci * 881261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 881361847f8eSopenharmony_ci * @atomicservice 881461847f8eSopenharmony_ci * @since 12 881561847f8eSopenharmony_ci */ 881661847f8eSopenharmony_ci WRITE = 2, 881761847f8eSopenharmony_ci 881861847f8eSopenharmony_ci /** 881961847f8eSopenharmony_ci * Check if the file has read permission. 882061847f8eSopenharmony_ci * 882161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 882261847f8eSopenharmony_ci * @atomicservice 882361847f8eSopenharmony_ci * @since 12 882461847f8eSopenharmony_ci */ 882561847f8eSopenharmony_ci READ = 4, 882661847f8eSopenharmony_ci 882761847f8eSopenharmony_ci /** 882861847f8eSopenharmony_ci * Check if the file has read and write permission. 882961847f8eSopenharmony_ci * 883061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 883161847f8eSopenharmony_ci * @atomicservice 883261847f8eSopenharmony_ci * @since 12 883361847f8eSopenharmony_ci */ 883461847f8eSopenharmony_ci READ_WRITE = 6, 883561847f8eSopenharmony_ci} 883661847f8eSopenharmony_ci 883761847f8eSopenharmony_ci/** 883861847f8eSopenharmony_ci * Enumeration of different types of access flag. 883961847f8eSopenharmony_ci * 884061847f8eSopenharmony_ci * @enum { number } access flag type 884161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 884261847f8eSopenharmony_ci * @since 12 884361847f8eSopenharmony_ci */ 884461847f8eSopenharmony_cideclare enum AccessFlagType { 884561847f8eSopenharmony_ci /** 884661847f8eSopenharmony_ci * Check if the file is on the local. 884761847f8eSopenharmony_ci * 884861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.File.FileIO 884961847f8eSopenharmony_ci * @since 12 885061847f8eSopenharmony_ci */ 885161847f8eSopenharmony_ci LOCAL = 0, 885261847f8eSopenharmony_ci} 8853