Whitebeam Object Definition
Adjusts the position within an open file according to a specified offset and origin
boolean = Binary.seek(offset, origin)
The 'Binary.seek' method takes 2 parameters:
|Name ||Type/Value ||Range/Length ||Description |
|offset||number|| ||Required. Offset from the origin. This can be positive or negative|
|origin||number|| ||Optional, default = fromStart|
Point at which to apply the offset adjustment
The 'Binary.seek' method returns boolean:
|Type/Value ||Range/Length ||Description |
Move the current read or write position within the currently open file. The offset is applied relative to an 'origin'. The origin by default
is the start of the file, but can be specified with an optional second parameter to be one of the following:
- obj.fromStart(default). Offset is effectively the absolute position within the file.
- obj.fromEnd Offset is fom the end of the file. Specifying an offset of -10 and this origin will move the point
to 10 characters from the end of the file.
- obj.fromCurrent Apply the offset from the current location. An offset of 10 moves forward 10 characters, -10 moves back 10 characters.
An exception is thrown if the binary object does not reference a currently opened file.
This method returns true if the change succeeds, false otherwise. A failure is generally the result
of the underlying object not supporting 'seek/tell' behaviour
|This operation works on both file system objects and Large Objects in Postgres (assuming Whitebeam is compiled with
(loadtime : 30ms)