| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) | 
Open a file stream and attach it to the HA lib
#include <ha/stdio.h>
    
int ha_fopen(const char *path, 
             const char *mode,
             RFp rfn, 
             void *rhdl, 
             unsigned haflags);
libha
In addition to opening the connection using the standard fopen() call, this convenience function also calls ha_attach() with the connection returned by the fopen() call.
The parameters rfn(), and rhdl(), and haflags() are passed to the ha_attach() call along with the connection ID returned by the underlying fopen() call.
The remaining parameters are passed to the corresponding parameters in the fopen() call in their appropriate positions.
A pointer to a file stream or NULL if an error occurs (errno is set).
The ha_fopen() call returns errors as returned by either the underlying fopen() call or the ha_attach() call.
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | Yes | 
ha_attach(), ha_detach(), ha_fclose()
In the Library Reference: fclose(), fopen()
| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) |