User's Guide

WRTASCII

Write ASCII text to the specified file

Function:

Write a line of ASCII text to a specified file. If the file doesn't exist, it will be created. If the file does exist, it will append to the end of it.

Parameters:

INFILE
Input file. The name of the file to update.

TEXT
Text string. The string of data to append to the file. Although this text is intended to be ASCII data, any type of data can be specified.

Examples:

  1. LAS> wrtascii infile=[adaps.data]ingest;dat text="this is a buffer of data"

    The ASCII text "This is a buffer of data" is written to the "INGEST;DAT" file located in the [ADAPS.DATA] directory. The text is appended as one new line at the end of the file.

Description/Algorithm:

The specified file is opened with append (write) permission. If there is an error opening the file (e.g. another process has the same file open), WRTASCII will wait for 10 seconds and try again. WRTASCII will try to re-open the specified file up to five times before a fatal error is encountered. When the file is successfully opened, the ASCII text is appended to the file.

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [wrtascii-fatal] Fatal error encountered

    A fatal error was encountered during processing. The error message displayed immediately preceding this message is the specific error encountered.

  2. [wrtascii-open] Error opening the file

    The specified file could not be opened. Check the protections on the file and the directory.

User Note:

  1. When the file is in use, WRTASCII will pause for 10 seconds and attempt to re-open the file up to five times before aborting.