DALIB(3)

NAME
da_open - Open a file or device to be used as DAT device.

SYNOPSIS
#include <sys/fcntl.h> #include dataudiolib.h

int
da_open( char *name , int mode)

DESCRIPTION
The da_open() function opens a filename and initialises internal status for the resulting descriptor in the library. If fd is associated with a tape device, this functions tries to load the last saved state of this tape device (if present).
You have to get a descriptor using either da_init or da_open before you can use the other functions.

PARAMETERS

  Input Parameters

name
    A filename in the UNIX filesystem.

mode
    May contain the same flags that can be passed to open(3) as defined in <sys/fcntl.h>. The library uses O_RDONLY,O_WRONLY, O_RDWR and O_NDELAY. (The mode is also passed to the open(3) function when opening the device.)

RETURN VALUE
This function returns an integer descriptor to be used with other da_xxx functions.
When an error condition arises, this routine returns -1 and sets errno to indicate the reason for the error. Possible values of errno are:

EINVAL
    The filedescriptor is invalid.

other
    The usual errors returned by open(3) and fstat(3) .

USAGE EXAMPLE

Open $TAPE as a DAT device.

		char *tape;
		tape=getenv("TAPE");
		if (tape==NULL)
			tape="/dev/rmt/0cn"; /* reasonable default */
		datfd=da_open(tape,O_RDWR);

SEE ALSO
da_intro(3),da_open(3)

AUTHOR
Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>