1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.file.fileAccess.d.ts 101.48 KB
一键复制 编辑 原始数据 按行查看 历史
zhouoaoteng 提交于 2024-07-23 19:34 +08:00 . fix:docs
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189
/*
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"),
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit CoreFileKit
*/
import type { AsyncCallback, Callback } from './@ohos.base';
import Want from './@ohos.app.ability.Want';
import Context from './application/Context';
import { Filter } from './@ohos.file.fs';
/**
* This module provides the capability to access user public files.
*
* @namespace fileAccess
* @syscap SystemCapability.FileManagement.UserFileService
* @since 9
*/
declare namespace fileAccess {
/**
* Query the want information of HAP configured with fileaccess.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { AsyncCallback<Array<Want>> } callback - The callback is used to return a Array<Want> object.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
function getFileAccessAbilityInfo(callback: AsyncCallback<Array<Want>>): void;
/**
* Query the want information of HAP configured with fileaccess.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @returns { Promise<Array<Want>> } Returns the wants.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
function getFileAccessAbilityInfo(): Promise<Array<Want>>;
/**
* Obtains the fileAccessHelper that connects all fileaccess servers in the system.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { Context } context Indicates the application context.
* @returns { FileAccessHelper } Returns the fileAccessHelper.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
function createFileAccessHelper(context: Context): FileAccessHelper;
/**
* Obtains the fileAccessHelper that connects some specified fileaccess servers in the system.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { Context } context Indicates the application context.
* @param { Array<Want> } wants Represents the connected data provider.
* @returns { FileAccessHelper } Returns the fileAccessHelper.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
function createFileAccessHelper(context: Context, wants: Array<Want>): FileAccessHelper;
/**
* File Object
*
* @interface FileInfo
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
interface FileInfo {
/**
* Indicates the path of the file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
uri: string;
/**
* Indicates the relativePath of the file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
relativePath: string;
/**
* Indicates the name of the file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
fileName: string;
/**
* Indicates the mode of the file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
mode: number;
/**
* Indicates the size of the file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
size: number;
/**
* Indicates the mtime of the file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
mtime: number;
/**
* Indicates the mimeType of the file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
mimeType: string;
/**
* List files in the current directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { Filter } filter Indicates the filter of file.
* @returns { FileIterator } Returns the FileIterator Object.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
listFile(filter?: Filter): FileIterator;
/**
* Recursively list all files in the current directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { Filter } filter Indicates the filter of file.
* @returns { FileIterator } Returns the FileIterator Object.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
scanFile(filter?: Filter): FileIterator;
}
/**
* FileIterator Object
*
* @interface FileIterator
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
interface FileIterator {
/**
* Get the next fileInfo.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @returns { object } Returns FileInfo Object and boolean flag.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
next(): { value: FileInfo, done: boolean };
}
/**
* Root Object
*
* @interface RootInfo
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
interface RootInfo {
/**
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
deviceType: number;
/**
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
uri: string;
/**
* File or directory relative path
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
relativePath: string;
/**
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
displayName: string;
/**
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
deviceFlags: number;
/**
* List files in the current directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { Filter } filter Indicates the filter of file.
* @returns { FileIterator } Returns the FileIterator Object.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
listFile(filter?: Filter): FileIterator;
/**
* Recursively list all files in the current directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { Filter } filter Indicates the filter of file.
* @returns { FileIterator } Returns the RootIterator Object.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
scanFile(filter?: Filter): FileIterator;
}
/**
* RootIterator Object
*
* @interface RootIterator
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
interface RootIterator {
/**
* Get a next RootInfo.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @returns { object } Returns RootInfo Object and boolean flag.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
next(): { value: RootInfo, done: boolean };
}
/**
* Describes the return information of the copy operation.
*
* @interface CopyResult
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
interface CopyResult {
/**
* Represents the source file or directory uri to be copied
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @stagemodeonly
* @since 10
*/
sourceUri: string;
/**
* Represents a file or directory uri in the target folder
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @stagemodeonly
* @since 10
*/
destUri: string;
/**
* Error code for failure to copy a file or directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @stagemodeonly
* @since 10
*/
errCode: number;
/**
* Error message for failure to copy a file or directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @stagemodeonly
* @since 10
*/
errMsg: string;
}
/**
* OPENFLAGS represents the way to open the file.
*
* @enum { number } OPENFLAGS
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
enum OPENFLAGS {
/**
* Open the file by Read-only mode.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
READ = 0o0,
/**
* Open the file by Write-only mode.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
WRITE = 0o1,
/**
* Open the file by Write-Read mode.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 9
*/
WRITE_READ = 0o2
}
/**
* Property elements that support the file queries.
*
* @enum { string } FileKey
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
enum FileKey {
/**
* The key represents the file name.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
DISPLAY_NAME = 'display_name',
/**
* The key represents the date of the file creation.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
DATE_ADDED = 'date_added',
/**
* The key represents the modify date of the file.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
DATE_MODIFIED = 'date_modified',
/**
* The key represents the relative path.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
RELATIVE_PATH = 'relative_path',
/**
* The key represents the file size.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
FILE_SIZE = 'size'
}
/**
* Describes the notifyType.
*
* @enum { number } NotifyType
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
enum NotifyType {
/**
* Type for add notification
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
NOTIFY_ADD,
/**
* Type for delete notification
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
NOTIFY_DELETE,
/**
* The file was moved into the monitored directory.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
NOTIFY_MOVED_TO,
/**
* The file in the monitored directory was moved.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
NOTIFY_MOVED_FROM,
/**
* The monitored file or directory was moved.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
NOTIFY_MOVE_SELF,
/**
* Event type of device online.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
NOTIFY_DEVICE_ONLINE,
/**
* Event type of device offline.
*
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
NOTIFY_DEVICE_OFFLINE
}
/**
* The value of the notify callback function
*
* @interface NotifyMessage
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
interface NotifyMessage {
/**
* Indicates the change type.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { NotifyType }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
type: NotifyType;
/**
* Indicates the uris generated the change event.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { Array<string> }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 10
*/
uris: Array<string>;
}
/**
* Describes the return information of the move operation.
*
* @interface MoveResult
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
interface MoveResult {
/**
* Indicates the source file or directory uri to be moved.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
sourceUri: string;
/**
* Indicates the file or directory uri in the destination folder.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
destUri: string;
/**
* Error code for failure to move a file or directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
errCode: number;
/**
* Error message for failure to move a file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
errMsg: string;
}
/**
* Indicates the root uri of the device
*
* @constant
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
const DEVICES_URI = 'file://docs';
/**
* FileAccessHelper Object
*
* @interface FileAccessHelper
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
interface FileAccessHelper {
/**
* Open a file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Indicates the path of the file to open.
* @param { OPENFLAGS } flags Indicate options of opening a file. The default value is read-only.
* @returns { Promise<number> } Returns the file descriptor.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
openFile(uri: string, flags: OPENFLAGS): Promise<number>;
/**
* Open a file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Indicates the path of the file to open.
* @param { OPENFLAGS } flags Indicate options of opening a file. The default value is read-only.
* @param { AsyncCallback<number> } callback - The callback is used to return the file descriptor.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
openFile(uri: string, flags: OPENFLAGS, callback: AsyncCallback<number>): void;
/**
* Create a file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Represents a specific parent directory.
* @param { string } displayName Indicates the new file name, and supports with suffix.
* @returns { Promise<string> } Returns the new file's URI.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
createFile(uri: string, displayName: string): Promise<string>;
/**
* Create a file.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Represents a specific parent directory.
* @param { string } displayName Indicates the new file name, and supports with suffix.
* @param { AsyncCallback<string> } callback - The callback is used to return the new file's URI.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
createFile(uri: string, displayName: string, callback: AsyncCallback<string>): void;
/**
* Create a Directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } parentUri Represents a specific parent directory.
* @param { string } displayName Indicates the new directory name.
* @returns { Promise<string> } Returns the new directory's URI.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
mkDir(parentUri: string, displayName: string): Promise<string>;
/**
* Create a Directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } parentUri Represents a specific parent directory.
* @param { string } displayName Indicates the new directory name.
* @param { AsyncCallback<string> } callback - The callback is used to return the new directory's URI.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
mkDir(parentUri: string, displayName: string, callback: AsyncCallback<string>): void;
/**
* Delete a file or delete a directory recursively.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Indicates the file or directory to be deleted.
* @returns { Promise<number> }
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
delete(uri: string): Promise<number>;
/**
* Delete a file or delete a directory recursively.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Indicates the file or directory to be deleted.
* @param { AsyncCallback<number> } callback
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
delete(uri: string, callback: AsyncCallback<number>): void;
/**
* Move a file or move a directory recursively.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceFile Indicates the file or directory to be moved.
* @param { string } destFile Represents the destination folder.
* @returns { Promise<string> } Returns the generated new file or directory.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
move(sourceFile: string, destFile: string): Promise<string>;
/**
* Move a file or move a directory recursively.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceFile Indicates the file or directory to be moved.
* @param { string } destFile Represents the destination folder.
* @param { AsyncCallback<string> } callback - The callback is used to return the generated new file or directory.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
move(sourceFile: string, destFile: string, callback: AsyncCallback<string>): void;
/**
* Copy file or directory in the promise way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be copied.
* @param { string } destUri - Represents the destination directory.
* @param { boolean } force - Optional parameter that determines whether to forcibly copy files.
* @returns { Promise<Array<CopyResult>> } Returns the file information where the error occurred.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
copy(sourceUri: string, destUri: string, force?: boolean): Promise<Array<CopyResult>>;
/**
* Copy file or directory in the asyncCallback way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be copied.
* @param { string } destUri - Represents the destination directory.
* @param { AsyncCallback<Array<CopyResult>> } callback - The callback is used to return the file information where the error occurred.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
copy(sourceUri: string, destUri: string, callback: AsyncCallback<Array<CopyResult>>): void;
/**
* Copy file or directory in the asyncCallback way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be copied.
* @param { string } destUri - Represents the destination directory.
* @param { boolean } force - Determines whether to forcibly copy files.
* @param { AsyncCallback<Array<CopyResult>> } callback - The callback is used to return the file information where the error occurred.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
copy(sourceUri: string, destUri: string, force: boolean, callback: AsyncCallback<Array<CopyResult>>): void;
/**
* copy the file with the specified file name in the promise way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be moved.
* @param { string } destUri - Represents the destination folder.
* @param { string } fileName - Represents the name of the specified file.
* @returns { Promise<string> } Returns the generated new file uri.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
copyFile(sourceUri: string, destUri: string, fileName: string): Promise<string>;
/**
* copy the file with the specified file name in the asyncCallback way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be moved.
* @param { string } destUri - Represents the destination folder.
* @param { string } fileName - Represents the name of the specified file.
* @param { AsyncCallback<string> } callback - Returns the generated new file uri.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
copyFile(sourceUri: string, destUri: string, fileName: string, callback: AsyncCallback<string>): void;
/**
* Rename the selected file or directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Indicates the selected file or directory.
* @param { string } displayName Indicates the new directory or file name.
* @returns { Promise<string> } Returns a URI representing the new file or directory.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
rename(uri: string, displayName: string): Promise<string>;
/**
* Rename the selected file or directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri Indicates the selected file or directory.
* @param { string } displayName Indicates the new directory or file name.
* @param { AsyncCallback<string> } callback - The callback is used to return a URI representing the new file or directory.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
rename(uri: string, displayName: string, callback: AsyncCallback<string>): void;
/**
* Obtain the status of a file or directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceFileUri Indicates the selected file or directory.
* @returns { Promise<boolean> } Returns whether it exists.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
access(sourceFileUri: string): Promise<boolean>;
/**
* Obtain the status of a file or directory.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceFileUri Indicates the selected file or directory.
* @param { AsyncCallback<boolean> } callback - The callback is used to return whether it exists.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
access(sourceFileUri: string, callback: AsyncCallback<boolean>): void;
/**
* Query file related information by the uri in the promise way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri - Indicates the selected file or directory.
* @param { string } metaJson The json string includes query property.
* @returns { Promise<string> } Returns the json string, includes query property and value.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
query(uri: string, metaJson: string): Promise<string>;
/**
* Query file related information by the uri in the asyncCallback way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri - Indicates the selected file or directory.
* @param { string } metaJson The json string includes query property.
* @param { AsyncCallback<string> } callback - Returns the json string, includes query property and value.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
query(uri: string, metaJson: string, callback: AsyncCallback<string>): void;
/**
* Get a FileInfo by the uri in the promise way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri - Indicates the selected file or directory.
* @returns { Promise<FileInfo> } Returns a FileInfo.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
getFileInfoFromUri(uri: string): Promise<FileInfo>;
/**
* Get a FileInfo by the uri in the asyncCallback way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri - Indicates the selected file or directory.
* @param { AsyncCallback<FileInfo> } callback - The callback is used to return a fileinfo object.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
getFileInfoFromUri(uri: string, callback: AsyncCallback<FileInfo>): void;
/**
* Get a FileInfo by the relative path in the promise way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } relativePath - Indicates the selected file or directory.
* @returns { Promise<FileInfo> } Returns a FileInfo.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
getFileInfoFromRelativePath(relativePath: string): Promise<FileInfo>;
/**
* Get a FileInfo by the relative path in the asyncCallback way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } relativePath - Indicates the selected file or directory.
* @param { AsyncCallback<FileInfo> } callback - The callback is used to return a fileinfo object.
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
getFileInfoFromRelativePath(relativePath: string, callback: AsyncCallback<FileInfo>): void;
/**
* Get a RootIterator.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @returns { Promise<RootIterator> } Returns a RootIterator.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
getRoots(): Promise<RootIterator>;
/**
* Get a RootIterator.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { AsyncCallback<RootIterator> } callback - The callback is used to return a RootIterator.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900006 - No such device or address
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900013 - Bad address
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900017 - No such device
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900029 - Resource deadlock would occur
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000002 - Invalid uri
* @throws { BusinessError } 14000003 - Invalid file extension
* @throws { BusinessError } 14000004 - File has been put into trash bin
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 9
*/
getRoots(callback: AsyncCallback<RootIterator>): void;
/**
* Turn on monitor the specified uri.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri - Indicates the file or directory to be monitored.
* @param { boolean } notifyForDescendants - Indicates Whether to monitor changes in descendants.
* @param { Callback<NotifyMessage> } callback - The callback is used to return the notify message.
* @throws { BusinessError } 14300002 - Invalid uri
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
registerObserver(uri: string, notifyForDescendants: boolean, callback: Callback<NotifyMessage>): void;
/**
* Turn off monitor the specified uri.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } uri - Indicates the file or directory the file that will cancel monitored.
* @param { Callback<NotifyMessage> } callback - The object bound to the uri.
* @throws { BusinessError } 14300002 - Invalid uri
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @since 10
*/
unregisterObserver(uri: string, callback?: Callback<NotifyMessage>): void;
/**
* Move file or directory in the promise way, And return the MoveResult.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be moved.
* @param { string } destUri - Represents the destination directory.
* @param { boolean } [force] - Optional parameter that determines whether to forcibly move files.
* @returns { Promise<Array<MoveResult>> } Returns the file information where the error occurred.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
moveItem(sourceUri: string, destUri: string, force?: boolean): Promise<Array<MoveResult>>;
/**
* Move file or directory in the asyncCallback way, and return the MoveResult.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be moved.
* @param { string } destUri - Represents the destination directory.
* @param { AsyncCallback<Array<MoveResult>> } callback - The callback is used to return the file information where the error occurred.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
moveItem(sourceUri: string, destUri: string, callback: AsyncCallback<Array<MoveResult>>): void;
/**
* Move file or directory in the asyncCallback way, and return the MoveResult.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be moved.
* @param { string } destUri - Represents the destination directory.
* @param { boolean } force - Determines whether to forcibly move files.
* @param { AsyncCallback<Array<MoveResult>> } callback - The callback is used to return the file information where the error occurred.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
moveItem(sourceUri: string, destUri: string, force: boolean, callback: AsyncCallback<Array<MoveResult>>): void;
/**
* Move the file with the specified file name in the promise way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be moved.
* @param { string } destUri - Represents the destination folder.
* @param { string } fileName - Represents the name of the specified file.
* @returns { Promise<string> } Returns the generated new file uri.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
moveFile(sourceUri: string, destUri: string, fileName: string): Promise<string>;
/**
* Move the file with the specified file name in the asyncCallback way.
*
* @permission ohos.permission.FILE_ACCESS_MANAGER
* @param { string } sourceUri - Indicates the file or directory to be moved.
* @param { string } destUri - Represents the destination folder.
* @param { string } fileName - Represents the name of the specified file.
* @param { AsyncCallback<string> } callback - The callback is used to return the generated new file uri.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 13900001 - Operation not permitted
* @throws { BusinessError } 13900002 - No such file or directory
* @throws { BusinessError } 13900004 - Interrupted system call
* @throws { BusinessError } 13900008 - Bad file descriptor
* @throws { BusinessError } 13900011 - Out of memory
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900014 - Device or resource busy
* @throws { BusinessError } 13900015 - File exists
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900019 - Is a directory
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 13900022 - Too many open files
* @throws { BusinessError } 13900023 - Text file busy
* @throws { BusinessError } 13900024 - File too large
* @throws { BusinessError } 13900025 - No space left on device
* @throws { BusinessError } 13900027 - Read-only file system
* @throws { BusinessError } 13900030 - File name too long
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 14300001 - IPC error
* @throws { BusinessError } 14300002 - Invalid uri
* @throws { BusinessError } 14300003 - Fail to get fileextension info
* @throws { BusinessError } 14300004 - Get wrong result
* @syscap SystemCapability.FileManagement.UserFileService
* @systemapi
* @StageModelOnly
* @since 11
*/
moveFile(sourceUri: string, destUri: string, fileName: string, callback: AsyncCallback<string>): void;
}
}
export default fileAccess;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助