Lines Matching refs:fs
7 When **fs.openSync()** with **mode** set to **OpenMode.READ_WRITE** is called to open a URI returne…
18 fs.openSync(uri, fs.OpenMode.WRITE_ONLY)
45 Use **fs.open(path: string, mode?: number)** with **mode** set to **fs.OpenMode.CREATE**.
56 let stream = fs.createStreamSync(filePath, "r+");
65 ## Why is an error reported when fs.copyFile is used to copy a datashare:// file opened by fs.open?…
69 **fs.copyFile** does not support URIs. You can use **fs.open()** to obtain the URI, obtain the file…
72 let file = fs.openSync("datashare://...")
73 fs.copyFile(file.fd, 'dstPath', 0).then(() => {
87 1. Use **fs.openSyn** to obtain the FD of the JSON file.
90 import fs from '@ohos.file.fs';
91 let sanFile = fs.open(basePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
95 2. Use **fs.readSync** to read the file content.
98 let content = fs.readSync(basePath);
107 4. Use **fs.writeSync** to write the data to the JSON file.
110 fs.writeSync(file.fd, JSON.stringify(obj));
113 For more information, see [@ohos.file.fs](../reference/apis/js-apis-file-fs.md).
131 You can use **fs.createWatcher** to listen for the changes of a file or folder with the registered …
135 [@ohos.file.fs](../reference/apis/js-apis-file-fs.md#fscreatewatcher10)