diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-09-05 20:37:28 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 20:37:28 +1000 |
commit | c73b4a0877ca134a05262dc15524f54ff471cc3a (patch) | |
tree | 25522be4b43ee2209ee924099f6f26bf3c053dad /ext/node/polyfills/_fs/_fs_write.mjs | |
parent | b01578ae1fc1da65ac38daec31a23c9ef652aa74 (diff) |
BREAKING(fs): remove `Deno.seek[Sync]()` (#25449)
Towards #22079
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_write.mjs')
-rw-r--r-- | ext/node/polyfills/_fs/_fs_write.mjs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/node/polyfills/_fs/_fs_write.mjs b/ext/node/polyfills/_fs/_fs_write.mjs index b4b133222..254094c9a 100644 --- a/ext/node/polyfills/_fs/_fs_write.mjs +++ b/ext/node/polyfills/_fs/_fs_write.mjs @@ -10,7 +10,6 @@ import { validateInteger, } from "ext:deno_node/internal/validators.mjs"; import * as io from "ext:deno_io/12_io.js"; -import * as fs from "ext:deno_fs/30_fs.js"; import { arrayBufferViewToUint8Array, getValidatedFd, @@ -19,6 +18,7 @@ import { } from "ext:deno_node/internal/fs/utils.mjs"; import { isArrayBufferView } from "ext:deno_node/internal/util/types.ts"; import { maybeCallback } from "ext:deno_node/_fs/_fs_common.ts"; +import { op_fs_seek_async, op_fs_seek_sync } from "ext:core/ops"; export function writeSync(fd, buffer, offset, length, position) { fd = getValidatedFd(fd); @@ -26,7 +26,7 @@ export function writeSync(fd, buffer, offset, length, position) { const innerWriteSync = (fd, buffer, offset, length, position) => { buffer = arrayBufferViewToUint8Array(buffer); if (typeof position === "number") { - fs.seekSync(fd, position, io.SeekMode.Start); + op_fs_seek_sync(fd, position, io.SeekMode.Start); } let currentOffset = offset; const end = offset + length; @@ -70,7 +70,7 @@ export function write(fd, buffer, offset, length, position, callback) { const innerWrite = async (fd, buffer, offset, length, position) => { buffer = arrayBufferViewToUint8Array(buffer); if (typeof position === "number") { - await fs.seek(fd, position, io.SeekMode.Start); + await op_fs_seek_async(fd, position, io.SeekMode.Start); } let currentOffset = offset; const end = offset + length; |