diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-05-26 16:18:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-26 16:18:27 +0200 |
commit | a11681a9b02f2f4a0f2bf6945a44b2937c6a9af1 (patch) | |
tree | 55b3a63959b2a935a86c30d8282fbe294f2bb892 /ext/node/polyfills/internal_binding/node_file.ts | |
parent | d72e0281ff41a87c32aefd0876bace23470a4dc5 (diff) |
refactor(node): use internal io and fs APIs (#19267)
Diffstat (limited to 'ext/node/polyfills/internal_binding/node_file.ts')
-rw-r--r-- | ext/node/polyfills/internal_binding/node_file.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/node/polyfills/internal_binding/node_file.ts b/ext/node/polyfills/internal_binding/node_file.ts index 82ff55b75..c81a7d830 100644 --- a/ext/node/polyfills/internal_binding/node_file.ts +++ b/ext/node/polyfills/internal_binding/node_file.ts @@ -26,6 +26,8 @@ // - https://github.com/nodejs/node/blob/master/src/node_file.h import { assert } from "ext:deno_node/_util/asserts.ts"; +import * as io from "ext:deno_io/12_io.js"; +import * as fs from "ext:deno_fs/30_fs.js"; /** * Write to the given file from the given buffer synchronously. @@ -58,13 +60,13 @@ export function writeBuffer( ); if (position) { - Deno.seekSync(fd, position, Deno.SeekMode.Current); + fs.seekSync(fd, position, io.SeekMode.Current); } const subarray = buffer.subarray(offset, offset + length); try { - return Deno.writeSync(fd, subarray); + return io.writeSync(fd, subarray); } catch (e) { ctx.errno = extractOsErrorNumberFromErrorMessage(e); return 0; |