hosts file

The hosts file defines file system connections to remote environments.

Synonym(s)

net-nodes

Note: The actual format of the hosts file may differ somewhat than the net-nodes file found on some other licensee platforms.

Description

The hosts file is used when accessing super Q-pointers to locate the appropriate OSFI driver and any options that should be passed to that driver.

Attribute Content
0 Host identifier to be used in attribute 3 of super Q-pointers
1 Generic File System interface driver number
1 O/S driver (UNIX/Windows)
2 TCP driver
3 Oracle driver
4 D3 FSI
8 OpenDB driver
A Workstation driver
101 Peqs (spooler) driver
102 D3 Binary driver
103 Header info driver
104 D3 VME
105 Shell Variable
2 Driver-specific configuration information
Attribute Content
3 Options and definitions
options Alphanumeric string that controls the behavior of the driver. Spaces can be inserted in the option string for readability. It follows the directory name, separated by a Value Mark:
tn Converts white space preceding text aligned to a tab-stop into a series of tabs. By default, no conversion occurs.
Note: This conversion option might modify the data (especially binary items), and is therefore only suggested for text files. The valid range of numbers for n is 2 through 9.
a Adds an extra attribute mark when files are moved into D3, and removes the attribute mark when the item is placed back in the host operating system.

This option is absolutely necessary when saving and/or copying between different files, or to backup media. Without this option, non-textual items might have an extra new-line appended to them when added to the final destination.

b Enables the ability to read and write binary data. No data translation occurs.
c Specifies the target is a special character file. This option imposes some restrictions.
d For Windows:
  • When copying Windows or MS-DOS text files from D3 to the host OS, replaces attribute marks with CR/LFs.
  • When copying Windows or MS-DOS text files from the host OS to D3, replaces CR/LFs with attribute marks.
lx For Windows:

Enables accessing a file without specifying the MS-DOS drive in the file name. x specifies the MS-DOS drive letter where the file is stored.

For example: To access a file located in MS-DOS drive A:, use the la option.

n Suppresses the conversion of attribute marks to new lines.

By default, when writing a D3 item, the attribute marks are converted to make the text easy to edit. A trailing attribute mark is added at the end of the file when it is written with this option unless the A option is specified.

o Prevents the conversion of tabs to spaces when copying files from D3 to the host operating system.
r Uses raw data. Reads and writes data much faster than the default and/or using some of the other options.

Cannot be specified with the A or T options.

If a character 255 (segment mark) is read from a file, it is converted into an underscore character.

s Case-insensitive item-ID and file names.

File names and item-IDs are converted to lowercase and makes them case-insensitive.

x Used with the binary driver to allow manipulation of binary data as a hexadecimal string. Refer to the host definition binx.
4 Unused
5 Unused
6 Description of hosts file item.

Host file items installed by default

  • bin, binary

    Used to access binary items in D3. When writing from the O/S into D3, the Q/S file is written to D3 as a pointer item without any translation. When writing from D3 to the O/S, value marks, attribute marks and segment marks are escaped with an 0x0A and followed by a different representation of the original character (0xFD becomes 0x105D, 0xFE becomes 0x105E, and 0xFF becomes 0x105F) while 0x10 becomes 0x1010.

    Driver: 01

  • binx

    Should never be used to read from the O/S into D3 or write from D3 into the O/S ( use bin or binary ) instead. When reading into a BASIC program variable, each byte is translated to a two-byte hex-ASCII representation of that byte. When writing the contents of a BASIC program variable, each two-byte hex-ASCII string is translated into one byte.

    Driver: 01

    Options: x

  • dos

    Used to access text files in Windows O/S directories. When reading from Windows into D3, carriage-return/line-feed sequences (0x0D0A) are converted to attribute marks (0xFE). When writing from D3 to Windows, attribute marks are converted to carriage-return/line feed sequences.

    Driver: 01

    Options: d

  • dost

    Used to access Windows text files, such as the dos driver, with the added feature of converting a tab to four spaces when reading from Windows into D3 or four spaces to a tab when writing from D3 to Windows.

    Driver: 01

    Options: dt4

  • drive letter (a, b, c … z)

    Identical in function to the dost driver. Shortcut notation for dost:x: (where x is the drive letter).

    Driver: 01

    Options: dt4lX (where X is the drive letter)

  • fsi

    Used by D3 Windows to access D3 files in the FSI on the local system or the FSI file system on remote D3 servers (FSI:[//servername]account,file,).

    CAUTION:
    Renaming or deleting this driver will have a severe negative impact on D3 Windows.

    Driver: 4

  • hdr

    Used by D3 to access item metadata ( see link to “Header files” topic )

    Driver: 103

  • host_bin, nt_bin, unixb

    Used for access to binary files in O/S directories. Reads from O/S to D3 binary with no translation whatsoever, given the correct OSFI driver is used on the destination file (bin, binary).

    Driver: 01

    Options: b

    Note: When used to open an O/S directory and read the file into a variable in a BASIC program, some embedded characters will cause unexpected results, including 0xFF (D3’s segment mark) and 0x10 (used by D3 to escape the segment mark as 0x105F).
  • nt, unix, unixr

    Used for “raw” access to binary (non-text) files in O/S directories. When reading from the O/S into D3, line-feeds (0x0A) are converted to attribute marks (0xFE). When writing from D3 to the O/S, attribute marks are converted to line feeds.

    Note: This is different from the previous text drivers in that the carriage return (0x0D) is left intact. Also, when reading from the O/S into D3, any segment marks (0xFF) are converted to underscores ( “_” ).

    Driver: 01

    Options: r

  • peqs

    Used by D3 to access the spooler. Gives the ability to manipulate D3 spooler hold entries from TCL or in a BASIC program (OPEN PEQS TO FILE THEN do whatever). When reading from peqs, carriage-return/line-feed sequences are converted to attribute marks. The reverse is true when writing to peqs. For more information, go to peqs.

    Driver: 101

  • unixt

    Behaves like the dost driver on Windows, except that there is no action taken on the carriage-return (0x0D) since that is rarely present in UNIX text files..

    Driver: 01

    Options: t4

  • var

    Used by D3 for @() shell variable access.

    Driver: 105

  • vme

    Used by D3 Windows to access VME resources.

    CAUTION:
    Renaming or deleting this driver will have a severe negative impact on D3, especially D3 Windows.

    Driver: 104

  • win

    Used for access to binary files in O/S directories, such as the previous three bin drivers, with the addition of an extra attribute mark (0xFE) at the end of the D3 item and will not convert line-feeds 0x0A) to attribute marks.

    Driver: 01

    Options: an

    When used to open an O/S directory and read the file into a variable in a BASIC program, some embedded characters will cause unexpected results, including 0xFF (D3’s segment mark) and 0x10 (used by D3 to escape the segment mark as 0x105F).

Manipulating O/S binary files in BASIC

No direct mechanism exists for reading O/S binary files (.JPG, .MP3, and so on) into a BASIC program variable. This is due to the translation of special characters commonly found in binary files that, if not translated, will confuse or be corrupted by D3. Segment marks, attribute marks, and value marks fall into this category.

Instead, you can do the following:

  1. Copy from the O/S into a D3 file using the nt_bin or unixb driver.
  2. Read the item from that file into a BASIC variable using the binx driver.
  3. Manipulate the hex-ASCII string in the program.
  4. Write the BASIC variable out to the D3 file using the binx driver.
  5. Copy the item out to the O/S using the nt_bin or unixb driver.

Example(s)

 data "(binx:hextest"
 execute \copy nt_bin:c:/temp test.txt\
 open 'binx:hextest' to file
 read item from file,"test.txt"
 *Manipulate item here.
 *This example replaces string for brevity.
 item = "6261FFFEFF6766"
 write item on file,"test.txt"
 data "(nt_bin:c:/temp"
 execute \copy binx:hextest test.txt\