# PxIOOpen

> Source: https://manual.pvxplus.com/pxio-library/library-functions/file-open-and-close-functions/pxioopen

## Description

Opens a PxPlus file

## Format

**int** **PxIOOpen(PxIOService service, PxIOFileHandle \*handle, const char \*pathname, int16_t isz, const char \*password, const char \*options, int flags);**

***Where:***

|  |  |
| --- | --- |
| **service** | PxIOService to use when opening the file. |
| **handle** | Pointer to storage to save the newly created PxIOFileHandle. |
| **pathname** | Pathname of the file to open. If remote, this should be relative to the remote system. |
| **isz** | Reserved for future use. |
| **password** | A NULL-terminated string containing the file password, if applicable. |
| **options** | Reserved for future use. |
| **flags** | A bit array specifying the methods to be used to open the file. The following predefined flags are allowed:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| OPEN_LOCK \| Opens the file for exclusive use \|<br>\| OPEN_READ_ONLY \| Opens the file as Read Only \|<br>\| OPEN_PURGE \| Purges the file of all entries immediately after opening \|<br>\| OPEN_BBX \| Opens the file in BBx® mode \| |

## Return Value

If the function succeeds, the file's record size is returned; otherwise, an error value is returned. More information on the nature of the error can be found by calling **[PxIOGetError](https://manual.pvxplus.com/pxio-library/library-functions/error-functions/pxiogeterror)**.

Note:  
Opens a PxPlus file locally or remotely, depending on the service passed in.

BBx® is a registered trademark of BASIS International Ltd.
