Quirrel4.41.0

iostream.blob.tell

Method of blob, from module "iostream"
instance.tell(): int

Returns the current stream position

Return value

See iostream.stream.tell for the generic contract.

Notes

This is the same cursor that seek, readn, writen, readblob and writeblob move; indexing a blob with [] does not move it.

Example

examples/iostream/blob/tell.nut
from "iostream" import blob

let b = blob(4)
println("b.tell() at start =", b.tell())
b.readn('i')
println("b.tell() after readn('i') =", b.tell())   // readn advanced the cursor by 4 bytes

b[0]                 // indexing reads a byte but never moves the cursor
println("b.tell() after b[0] =", b.tell())
Output:
b.tell() at start = 0
b.tell() after readn('i') = 4
b.tell() after b[0] = 4

See also

tellReturns the current stream position
seekSeeks to the given offset; origin is 'b' (begin), 'c' (current) or 'e' (end)
lenReturns the stream length
blobclass index