Deno: Deno.seek does not support 64bits integer

Created on 25 Jun 2020  路  1Comment  路  Source: denoland/deno

Why is Deno not supporting i64 as seek offset ?

It should ! Linux has devices or other big files that can be seek with a big offset.

Here is the stacktrace when trying to seek a 64bits integer:

error: Uncaught InvalidData: invalid value: integer `56762287783936`, expected i32
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at [...]

Reproduce code:

  const file = await Deno.open(
    `/proc/${pid}/mem`,
    { read: true, write: true, truncate: false, create: false },
  );
   const offset: i64 = 56762287783936;
   await file.seek(offset, Deno.SeekMode.Start);
bug cli

Most helpful comment

Why is Deno not supporting i64 as seek offset ?

Not sure what happened here, this predates me but its being lowered to i32 before being passed into seek which takes u64.

It should !

Yes, it's in my backlog.

Also mentioned in #6169

>All comments

Why is Deno not supporting i64 as seek offset ?

Not sure what happened here, this predates me but its being lowered to i32 before being passed into seek which takes u64.

It should !

Yes, it's in my backlog.

Also mentioned in #6169

Was this page helpful?
0 / 5 - 0 ratings

Related issues

somombo picture somombo  路  3Comments

doutchnugget picture doutchnugget  路  3Comments

zugende picture zugende  路  3Comments

JosephAkayesi picture JosephAkayesi  路  3Comments

CruxCv picture CruxCv  路  3Comments