general.binary.q.ptr Definition/General

general.binary.q.ptr

Command general.binary.q.ptr Definition/General
Applicable release versions: AP 6.2
Category General (155)
Description accessing binary items using normal Pick utilities.
Through the 6.2 OSFI, it is possible to access binary items as if they were normal Pick items, using Access, Pick BASIC, FlashBASIC, etc...

Conventions :

Since a standard Pick item is generally accessed in a different manner than a binary item, several conventions are observed:

- The following characters in binary items are converted to the corresponding escaped sequences when read through the binary interface. This conversion is reversed when writing an item. Note that this translation scheme is identical to that used by the Unix interface making it possible to store foreign data inside a Pick binary item exactly as it appeared in the foreign file system.

SM DLE _
AM DLE ^
VM DLE ]
SVM DLE
DLE DLE DLE

- An attempt to read a non-binary item will return the item without any translation.

- When writing an item through the binary interface, the resulting item is always made binary. The length of the actual data (after applying the above translations in reverse) is stored in the item header and is transfered by all standard utilities including copy, t-dump, t-load, save, and restore.

- Older Pick binary items which do not have binary lengths may return a number of character 0's at the end of the data when that item is read.

Q-Pointer Format :

The format of the binary Q-pointer is:
file.name
001 Q
002
003 binary:filename

'binary' is the name of the 'binary' host in the 'dm,hosts,' file.

'filename' is the name of the Pick file. The use of the binary Q-pointer is generally unnecessary for non-Pick files since the drivers accessing those files already convert binary data into a non-binary, escaped format identical to that used by the binary driver.

Optionally, the file may be opened directly by adding the "binary:" prefix to the file name.
Syntax
Options
Example
The following example displays the textual portion of some BASIC object code.

:ct dict binary:bp test
001 ............]}..............:. B..B..who._.. u0.P..E._..
    test.]9885.[38516.]7.]bh/]brad.]6.2.0.M0.A2.D2.F5.].^._.
    ............................................(many more dots)

The following example copies a binary image from a DOS machine (via an NFS 
link) into a standard PICK item.  Note that the standard Pick item is NOT a 
binary item since any binary information has already been escaped when the data 
is transfered from DOS to Pick. The second command copies this item into a true 
Pick binary item. The data in this binary item corresponds exactly to the data 
in the original DOS image.

copy /dos PIC001.GIR
(pictures
   1 PIC001.GIR

:copy pictures PIC001.GIR
(bin:pictures2
   1 PIC001.GIR
Purpose
Related general.super.q.ptr
general.remote
filename.hosts
qs-pointer
s-pointer
general.osfi