Whitebeam Object Definition

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Object Definition

Method Description

Binary.seek()

Adjusts the position within an open file according to a specified offset and origin

Syntax

boolean = Binary.seek(offset, origin)

Parameters

The 'Binary.seek' method takes 2 parameters:

Name Type/Value Range/Length Description
offsetnumber  Required. Offset from the origin. This can be positive or negative
originnumber  Optional, default = fromStart
Point at which to apply the offset adjustment

Results

The 'Binary.seek' method returns boolean:

Type/Value Range/Length Description
boolean  

Remarks

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 Postgres enabled)
Whitebeam release 1.3.36
(loadtime : 27ms)