* Appends to a file synchronously. * @param {string} path The file path * @param {Buffer|string} data The data to append * @param {object} [options] Options
(path, data, options)
| 337 | * @param {object} [options] Options |
| 338 | */ |
| 339 | appendFileSync(path, data, options) { |
| 340 | if (this.readonly) { |
| 341 | throw createEROFS('open', path); |
| 342 | } |
| 343 | const flag = options?.flag ?? 'a'; |
| 344 | const handle = this.openSync(path, flag, options?.mode); |
| 345 | try { |
| 346 | handle.writeFileSync(data, options); |
| 347 | } finally { |
| 348 | handle.closeSync(); |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | /** |
| 353 | * Checks if a path exists. |
no test coverage detected