Lines Matching refs:fs
13 为适配统一的API异常处理方式,对fileio相关接口进行废弃,并新增对应接口,原接口位于@ohos.fileio,新接口位于@ohos.file.fs。新增接口支持统一的错误码异常处理规范,功能上…
19 | @ohos.file.fs | **function** open(path: string, mode?: number, callback?: AsyncCallback<File>):…
20 | @ohos.file.fs | **function** openSync(path: string, mode?: number): File; | 新增 |
23 | @ohos.file.fs | **function** read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; …
24 | @ohos.file.fs | **function** readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: numb…
29 | @ohos.file.fs | **function** stat(file: string \| number, callback?: AsyncCallback<Stat>): void …
30 | @ohos.file.fs | **function** statSync(file: string \| number): Stat; | 新增 |
35 | @ohos.file.fs | **function** truncate(file: string \| number, len?: number, callback?: AsyncCall…
36 | @ohos.file.fs | **function** truncateSync(file: string \| number, len?: number): void; | 新增 |
39 | @ohos.file.fs | **function** write(fd: number, buffer: ArrayBuffer \| string, options?: { offset…
40 | @ohos.file.fs | **function** writeSync(fd: number, buffer: ArrayBuffer \| string, options?: { of…
50 现新接口使用的是@ohos.file.fs,以以下方式import:
53 import fs from '@ohos.file.fs';
58 import fs from '@ohos.file.fs'
61 let file = fs.openSync(path, fs.OpenMode.READ_ONLY);
68 import fs from '@ohos.file.fs'
71 let file = await fs.open(path, fs.OpenMode.READ_ONLY);
79 import fs from '@ohos.file.fs'
82 fs.open(path, fs.OpenMode.READ_ONLY, function(e, file){ //异步线程的错误(如系统调用等)在回调中获取