summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal_binding/node_file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/internal_binding/node_file.ts')
-rw-r--r--ext/node/polyfills/internal_binding/node_file.ts6
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;