OpenTP1 Version 7 Programming Reference C Language
dc_dam_put - Output a physical file block
Format
ANSI C, C++
#include <dcdami.h> int dc_dam_put (int fno, char *datadr, int datalen, DCLONG flags) |
K&R C
#include <dcdami.h> int dc_dam_put (fno, datadr, datalen, flags) int fno; char *datadr; int datalen; DCLONG flags; |
Description
The function dc_dam_put() sequentially outputs data in blocks to a physical file created in the OpenTP1 file system. If the value specified for the data length is smaller than the value specified for the block length, the remaining part following the data is padded with null characters. If the value specified for the data length is greater than the value specified for the block length, an error is returned.
When outputting a physical file block, specify the file descriptor which is the return value of the function dc_dam_create() or dc_dam_iopen().
Argument whose values are set in the UAP
fno
Specify the file descriptor of the file to which a block is output.
datadr
Specify the address of the data to be output.
datalen
Specify the length of the data to be output. You can specify a value in the range from 504 to 2147483647.
flags
Specify DCNOFLAGS.
Return values
Return value | Return value (numeric) | Explanation |
---|---|---|
Positive integer | A positive integer indicates the length of the data to be output (the value specified for datalen). | |
DCDAMER_BADF | -1603 | The file descriptor specified for fno is not the one which was acquired by opening the file normally, or the specified file is not open. |
DCDAMER_BUFER | -1604 | The value specified for the data length is greater than the value specified for the block length. |
The value specified for the output data length is outside the range of values that can be specified. | ||
DCDAMER_SEQER | -1605 | The call sequence of functions which access the DAM file is invalid. |
DCDAMER_PARAM_FLAGS | -1611 | The value specified for flags is invalid. |
DCDAMER_IOER | -1620 | An output error occurred. |
DCDAMER_ACCESS | -1628 | A DAM file to be accessed is protected with the security facility. The UAP that called the function dc_dam_put() has no access permission. |
DCDAMER_EOF | -1637 | The end of the file is reached. |
DCDAMER_NO_ACL | -1646 | A DAM file to be accessed is protected with the security facility. There is no ACL for the corresponding file. |
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.