dc_dam_iopen - Open a physical file

Format

ANSI C, C++

#include <dcdami.h>
int dc_dam_iopen (char *fname, int pnum, DCLONG flags)

K&R C

#include <dcdami.h>
int dc_dam_iopen (fname, pnum, flags)
char     *fname;
int      pnum;
DCLONG   flags;

Description

The function dc_dam_iopen() opens a physical file created in the OpenTP1 file system. However, this function cannot open a physical file being used in online mode.

Arguments whose values are set in the UAP

fname

Specify the name of a physical file to be opened with a path name within (special file name + 14 bytes).

pnum

Specify the number of blocks collectively processed which is used as an input/output unit.

flags

Specify the type of request (creation output request or re-creation (overwrite) output request). The value specified here determines whether to pad the remaining area with blocks of null characters when the file is closed. The value set here will come into effect when the call of the function dc_dam_iclose() subsequent to the function dc_dam_put() brings about normal termination. Even though the function dc_dam_put() is called, the remaining area will not be padded with blocks of null characters provided that UAP processing is terminated without the call of the function dc_dam_iclose().

DCDAM_INITIALIZE
The creation output request type is specified. (The remaining area is padded with blocks of null characters.)
DCDAM_OVERWRITE
The re-creation output request type is specified. (The remaining area is not padded with blocks of null characters.)

When DCNOFLAGS is specified, DCDAM_OVERWRITE is assumed to be specified.

Return values

Return valueReturn value (numeric)Explanation
0 or positive integer0 or a positive integer indicates the file descriptor.
DCDAMER_NOMEM-1607The memory became insufficient.
DCDAMER_OPENED-1608The physical file specified for fname is open.
DCDAMER_PARAM_FLAGS-1611The value specified for flags is invalid.
DCDAMER_FILEER-1614The physical file name specified for fname is invalid.
DCDAMER_PNUMER-1615The value specified for the number of blocks collectively processed is invalid.
DCDAMER_NODAM-1616The physical file specified for fname is not a DAM file.
DCDAMER_VERSION-1618The OpenTP1 file system versions used for creation and allocation do not match each other.
DCDAMER_NOEXIST-1619The physical file specified for fname does not exist.
DCDAMER_IOER-1620An input/output error occurred.
DCDAMER_ACCESS-1628The UAP that called the function dc_dam_iopen() does not have the access permission for special files.
DCDAMER_LFNMER-1632The physical file is not a character special file, or the device corresponding to the special file does not exist.
DCDAMER_LNOINT-1633The physical file specified for fname has not been initialized as an OpenTP1 file system.
DCDAMER_LFNOVF-1635The specified value exceeds the maximum number of files which can be opened for the process.
DCDAMER_USED-1636The physical file specified for fname is being used in online mode, or it is being used by another process.
DCDAMER_ACCESSF-1638The access permission for physical files has not been granted.
DCDAMER_CRUSH-1639Physical file damage was detected.