diff options
Diffstat (limited to 'ext/fs/30_fs.js')
-rw-r--r-- | ext/fs/30_fs.js | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index d0f7a2fad..810089950 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -670,85 +670,90 @@ class FsFile { } get rid() { + internals.warnOnDeprecatedApi( + "Deno.FsFile.rid", + new Error().stack, + "Use `Deno.FsFile` methods directly instead.", + ); return this.#rid; } write(p) { - return write(this.rid, p); + return write(this.#rid, p); } writeSync(p) { - return writeSync(this.rid, p); + return writeSync(this.#rid, p); } truncate(len) { - return ftruncate(this.rid, len); + return ftruncate(this.#rid, len); } truncateSync(len) { - return ftruncateSync(this.rid, len); + return ftruncateSync(this.#rid, len); } read(p) { - return read(this.rid, p); + return read(this.#rid, p); } readSync(p) { - return readSync(this.rid, p); + return readSync(this.#rid, p); } seek(offset, whence) { - return seek(this.rid, offset, whence); + return seek(this.#rid, offset, whence); } seekSync(offset, whence) { - return seekSync(this.rid, offset, whence); + return seekSync(this.#rid, offset, whence); } stat() { - return fstat(this.rid); + return fstat(this.#rid); } statSync() { - return fstatSync(this.rid); + return fstatSync(this.#rid); } async dataSync() { - await op_fs_fdatasync_async(this.rid); + await op_fs_fdatasync_async(this.#rid); } dataSyncSync() { - op_fs_fdatasync_sync(this.rid); + op_fs_fdatasync_sync(this.#rid); } close() { - core.close(this.rid); + core.close(this.#rid); } get readable() { if (this.#readable === undefined) { - this.#readable = readableStreamForRid(this.rid); + this.#readable = readableStreamForRid(this.#rid); } return this.#readable; } get writable() { if (this.#writable === undefined) { - this.#writable = writableStreamForRid(this.rid); + this.#writable = writableStreamForRid(this.#rid); } return this.#writable; } async sync() { - await op_fs_fsync_async(this.rid); + await op_fs_fsync_async(this.#rid); } syncSync() { - op_fs_fsync_sync(this.rid); + op_fs_fsync_sync(this.#rid); } [SymbolDispose]() { - core.tryClose(this.rid); + core.tryClose(this.#rid); } } |