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