# File Write Functions

PxIOWrite |

## Description

Writes a record to a file

## Format

int PxIOWrite(PxIOFileHandle handle, RecordInfo *record, BOOL overwrite);

Where:

handle | The handle of an open file
record | A pointer to a RecordInfo structure containing a pointer to the record to be written and its size. The calling procedure is responsible for constructing a valid PxPlus data record using field separators as required. PxIOWrite will pad the data record with nulls as required for files with fixed length records.
overwrite | If writing to a keyed file and the data in the passed record will result in a conflict within one or more of the file's key sequences, this flag indicates whether or not the file record causing the current key sequence conflict(s) should be overwritten. If TRUE is passed, the overwrite occurs; otherwise, no change is made to the file, and an ERR_DOM (duplicate or missing key error) is returned.

## Return Value

If the function succeeds, a value of PXIO_SUCCESS_STATUS is returned; otherwise, an error value is returned. More information on the nature of the error can be found by calling PxIOGetError.