Background documentationfile_getfirst Locate this document in the navigation structure

 

You open the specified database file. The first block of file content is displayed.

In the command line you can only use the DBM command to display the content of plain text files. Programs can access the content of binary files via the DBM interface.

For plain text files, the data is read from the file line by line. Each line is extended by a line feed (0x0D,0x0A) in the output area.

On a Unix computer, the line feed consists of one character only. This is why the value initially output for the file length may be smaller than the data length.

As you can only access database files with this DBM command, you do not need to log on to the operating system.

Prerequisites

  • You have the server authorization DBFileRead.

  • You have determined the file ID of the requested database file (see: file_getlist).

Structure

file_getfirst <file_ID> [<file_spec>]

<file_spec> :: = DATE=<timestamp> | LINE=<nnn>

Options

Option

Description

<file_ID>

For possible file ID values, see: Database Administration, Log Files or

Configuration Files

DATE=<timestamp>

The content is output from the line with the specified timestamp.

LINE=<nnn>

The content of text files is output from line nnn.

Result

OK

<file_handle>

CONTINUE|END

<file_length><data_length>

<data_line>

<data_line>

...

Values for the Reply Fields

Value

Description

<file_handle>

Numeric value that can be used for subsequent access to this file.

END

The content of the file has been transferred completely. The file is closed automatically.

CONTINUE

The file contains further entries that were not transferred due to the limited size of the reply package. You can display this data by entering the DBM command again or close the file.

<file_length>

File length

Length of entry: max. 20 characters

<data_length>

Length of the displayed data block

Length of entry: max. 20 characters

<data_line>

Data line

In the event of errors, see Reply Format.

More Information

Glossary, Database File