irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Collaboration diagram for Client Data Object Operations:

Functions

int rcBulkDataObjPut (rcComm_t *conn, bulkOprInp_t *bulkOprInp, bytesBuf_t *bulkOprInpBBuf)
 
int rcDataObjChksum (rcComm_t *conn, dataObjInp_t *dataObjChksumInp, char **outChksum)
 
int rcDataObjClose (rcComm_t *conn, openedDataObjInp_t *dataObjCloseInp)
 
int rcDataObjCopy (rcComm_t *conn, dataObjCopyInp_t *dataObjCopyInp)
 
int rcDataObjCreate (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjCreateAndStat (rcComm_t *conn, dataObjInp_t *dataObjInp, openStat_t **openStat)
 
int rcDataObjGet (rcComm_t *conn, dataObjInp_t *dataObjInp, char *locFilePath)
 
int rcDataObjLock (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjLseek (rcComm_t *conn, openedDataObjInp_t *dataObjLseekInp, fileLseekOut_t **dataObjLseekOut)
 
int rcDataObjOpen (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjOpenAndStat (rcComm_t *conn, dataObjInp_t *dataObjInp, openStat_t **openStat)
 
int rcDataObjPhymv (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjPut (rcComm_t *conn, dataObjInp_t *dataObjInp, char *locFilePath)
 
int rcDataObjRead (rcComm_t *conn, openedDataObjInp_t *dataObjReadInp, bytesBuf_t *dataObjReadOutBBuf)
 
int rcDataObjRename (rcComm_t *conn, dataObjCopyInp_t *dataObjRenameInp)
 
int rcDataObjRepl (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjRsync (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjTrim (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjTruncate (rcComm_t *conn, dataObjInp_t *dataObjInp)
 
int rcDataObjUnlink (rcComm_t *conn, dataObjInp_t *dataObjUnlinkInp)
 
int rcDataObjWrite (rcComm_t *conn, openedDataObjInp_t *dataObjWriteInp, bytesBuf_t *dataObjWriteInpBBuf)
 
int rcObjStat (rcComm_t *conn, dataObjInp_t *dataObjInp, rodsObjStat_t **rodsObjStatOut)
 
int rcPhyPathReg (rcComm_t *conn, dataObjInp_t *phyPathRegInp)
 

Detailed Description

Function Documentation

◆ rcBulkDataObjPut()

rcBulkDataObjPut ( rcComm_t conn,
bulkOprInp_t bulkOprInp,
bytesBuf_t bulkOprInpBBuf 
)
Description:\n Put (upload) multiple data objects to iRODS with a single call.
Info on each file being uploaded are provided in the arrays in bulkOprInp and the contents of each file are concatenated in the bulkOprInpBBuf input.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Upload two local files - myfile1 and myfile2 to iRODS in the /myZone/home/john/mydir collection and myRescource resource.

bulkOprInp_t bulkOprInp;
int status;
struct stat statbuf;
rodsLong_t size1, size2;
int mode1, mode2;
bytesBuf_t bulkOprInpBBuf;
char *bufPtr;
int fd;

bzero (bulkOprInp, sizeof (bulkOprInp_t));
rstrcpy (bulkOprInp.objPath, "/myZone/home/john/mydir", MAX_NAME_LEN);
addKeyVal (&bulkOprInp.condInput, DEST_RESC_NAME_KW, "myRescource");
initAttriArrayOfBulkOprInp (bulkOprInp);

status = stat ("myfile1", &statbuf);
if (status < 0) {
.... handle the error
}
mode1 = statbuf.st_mode;
size1 = statbuf.st_size;
status = stat ("myfile2", &statbuf);
if (status < 0) {
.... handle the error
}
mode2 = statbuf.st_mode;
size2 = statbuf.st_size;
# allocate the buffer for read
bzero (&bulkOprInpBBuf, sizeof (bulkOprInpBBuf));
bufPtr = bulkOprInpBBuf.buf = malloc ((int) (size1 + size2));
# read myfile1
fd = open ("myfile1", O_RDONLY, 0);
if (fd < 0) {
.... handle the error
}


status = read (fd, bufPtr, (uint) size1);
if (status != size1) {
.... handle the error
}
close (fd);
# add myfile1 to the input array
status = fillAttriArrayOfBulkOprInp ("/myZone/home/john/mydir/myfile1",
mode1, NULL, (int) size1, &bulkOprInp);
if (status < 0) {
.... handle the error
}
# read in myfile2
bufPtr += size1;
fd = open ("myfile2", O_RDONLY, 0);
if (fd < 0) {
.... handle the error
}
status = read (fd, bufPtr, (uint) size2);
if (status != size2) {
.... handle the error
}
close (fd);
# add myfile2 to the input array
status = fillAttriArrayOfBulkOprInp ("/myZone/home/john/mydir/myfile2",
mode2, NULL, (int) size2, &bulkOprInp);
if (status < 0) {
.... handle the error
}
# upload the 2 files
status = rcBulkDataObjPut (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}

Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]bulkOprInp- Elements of bulkOprInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the top target collection.
  • attriArray - a genQueryOut_t containing arrays on info on the files being uploaded. The initAttriArrayOfBulkOprInp() call initializes this struct for bulk operations. Arrays needed for bulk operations are:
    COL_DATA_NAME - the full paths of each data object.
    COL_DATA_MODE - the createMode of each data object.
    OFFSET_INX - The accummulative size of the data objects. e.g., suppose we are bulk loading 2 files with sizes s1 and s2 repectively,. The 2 elements of this array are, s1 and s1+s2.
    COL_D_DATA_CHECKSUM - The checksum values of each data object. This array is only needed if REG_CHKSUM_KW or VERIFY_CHKSUM_KW is specified in the condInput.
    The fillAttriArrayOfBulkOprInp() call can be used to fill these arrays for one data object.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    DEST_RESC_NAME_KW - The resource to store this data object
    FORCE_FLAG_KW - overwrite existing copy. This keyWd has no value
    REG_CHKSUM_KW - register the target checksum value after the copy. The value is the md5 checksum value of the local file.
    VERIFY_CHKSUM_KW - verify and register the target checksum value after the copy. The value is the md5 checksum value of the local file.
[in]bulkOprInpBBuf- concatenated contents of all input files
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 143 of file rcBulkDataObjPut.cpp.

References BULK_DATA_OBJ_PUT_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by rsBulkDataObjPut(), and sendBulkPut().

Here is the call graph for this function:

◆ rcDataObjChksum()

rcDataObjChksum ( rcComm_t conn,
dataObjInp_t dataObjChksumInp,
char **  outChksum 
)
Description:\n Compute the md5 checksum of a data object and register the checksum
value with iCAT.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Chksum the data object /myZone/home/john/myfile if one does not already exist in iCAT.
dataObjInp_t dataObjInp;
char *outChksum = NULL;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
status = rcDataObjChksum (conn, &dataObjInp, &outChksum);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjChksumInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    VERIFY_CHKSUM_KW - verify the checksum value in iCAT. If the checksum value does not exist, compute and register one. This keyWd has no value.
    FORCE_CHKSUM_KW - checksum the data-object even if a checksum already exists in iCAT. This keyWd has no value.
    CHKSUM_ALL_KW - checksum all replicas. This keyWd has no value.
    REPL_NUM_KW - The replica number of the replica to delete.
    RESC_NAME_KW - delete replica stored in this resource.
[out]outChksum- a string containing the md5 checksum value.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 70 of file rcDataObjChksum.cpp.

References DATA_OBJ_CHKSUM_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by chksumDataObjUtil(), and rsDataObjChksum().

Here is the call graph for this function:

◆ rcDataObjClose()

rcDataObjClose ( rcComm_t conn,
openedDataObjInp_t dataObjCloseInp 
)
Description:\n Close an opened data object.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Close an open a data object:
dataObjInp_t dataObjInp;
openedDataObjInp_t dataObjCloseInp;
int status;
bzero (&dataObjInp, sizeof (dataObjInp));
bzero (&dataObjCloseInp, sizeof (dataObjCloseInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.openFlags = O_WRONLY;
dataObjCloseInp.l1descInx = rcDataObjOpen (conn, &dataObjInp);
if (dataObjCloseInp.l1descInx < 0) {
.... handle the error
}
.... do some I/O (rcDataObjWrite) ....
status = rcDataObjClose (conn, &dataObjCloseInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjCloseInp- Elements of openedDataObjInp_t used :
  • int l1descInx - the opened data object descriptor from rcDataObjOpen or rcDataObjCreate.
Returns
integer
Return values
0on success.
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 63 of file rcDataObjClose.cpp.

References DATA_OBJ_CLOSE_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by catDataObj(), irsDataObjClose(), lfRestartGetWithInfo(), and lfRestartPutWithInfo().

Here is the call graph for this function:

◆ rcDataObjCopy()

rcDataObjCopy ( rcComm_t conn,
dataObjCopyInp_t dataObjCopyInp 
)
Description:\n Copy a data object from a iRODS path to another a iRODS path.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Copy a data object /myZone/home/john/myfileA to /myZone/home/john/myfileB and store in myRescource:
dataObjCopyInp_t dataObjCopyInp;
bzero (&dataObjCopyInp, sizeof (dataObjCopyInp));
rstrcpy (dataObjCopyInp.destDataObjInp.objPath, "/myZone/home/john/myfileB", MAX_NAME_LEN);
rstrcpy (dataObjCopyInp.srcDataObjInp.objPath, "/myZone/home/john/myfileA", MAX_NAME_LEN);
addKeyVal (&dataObjCopyInp.destDataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcDataObjCopy (conn, &dataObjCopyInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjCopyInp- Elements of dataObjCopyInp_t used :
  • char srcDataObjInp.objPath[MAX_NAME_LEN] - full path of the source data object.
  • char destDataObjInp.objPath[MAX_NAME_LEN] - full path of the target data object.
  • int destDataObjInp.numThreads - the number of threads to use. Valid values are:
    NO_THREADING (-1) - no multi-thread
    0 - the server will decide the number of threads. (recommanded setting).
    A positive integer - specifies the number of threads.
  • keyValPair_t destDataObjInp.condInput - keyword/value pair input. Valid keywords:
    DATA_TYPE_KW - the data type of the data object.
    FORCE_FLAG_KW - overwrite existing target. This keyWd has no value
    REG_CHKSUM_KW - register the target checksum value after the copy. This keyWd has no value.
    VERIFY_CHKSUM_KW - verify and register the target checksum value after the copy. This keyWd has no value.
    DEST_RESC_NAME_KW - The resource to store this data object
    FILE_PATH_KW - The physical file path for this data object if the normal resource vault is not used.
    RBUDP_TRANSFER_KW - use RBUDP for data transfer. This keyWd has no value
    RBUDP_SEND_RATE_KW - the number of RBUDP packet to send per second The default is 600000
    RBUDP_PACK_SIZE_KW - the size of RBUDP packet. The default is 8192
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 85 of file rcDataObjCopy.cpp.

References _rcDataObjCopy(), COPY_DEST, COPY_SRC, DataObjCopyInp::destDataObjInp, NULL, DataObjInp::oprType, DataObjCopyInp::srcDataObjInp, irods.pypyodbc::status, and rcComm_t::transStat.

Referenced by cpFileUtil(), and rsyncDataToDataUtil().

Here is the call graph for this function:

◆ rcDataObjCreate()

rcDataObjCreate ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Create a data object in the iCAT. This is equivalent to creat of UNIX.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Create a data object /myZone/home/john/myfile in myRescource:
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.createMode = 0750;
dataObjInp.dataSize = 12345;
addKeyVal (&dataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcDataObjCreate (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • int createMode - the file mode of the data object.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    DATA_TYPE_KW - the data type of the data object.
    DEST_RESC_NAME_KW - The resource to store this data object
    FILE_PATH_KW - The physical file path for this data object if the normal resource vault is not used.
    FORCE_FLAG_KW - overwrite existing copy. This keyWd has no value
Returns
integer
Return values
anopened object descriptor on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 67 of file rcDataObjCreate.cpp.

References DATA_OBJ_CREATE_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Here is the call graph for this function:

◆ rcDataObjCreateAndStat()

rcDataObjCreateAndStat ( rcComm_t conn,
dataObjInp_t dataObjInp,
openStat_t **  openStat 
)
Description:\n Create a data object in the iCAT. This API is the same as
the rcDataObjCreate API except an additional openStat_t struct containing the stat of the just created object is returned.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Create a data object /myZone/home/john/myfile in myRescource:
dataObjInp_t dataObjInp;
openStat_t *openStat = NULL;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.createMode = 0750;
dataObjInp.dataSize = 12345;
addKeyVal (&dataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcDataObjCreateAndStat (conn, &dataObjInp, &openStat);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • int createMode - the file mode of the data object.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    DATA_TYPE_KW - the data type of the data object.
    DEST_RESC_NAME_KW - The resource to store this data object
    FILE_PATH_KW - The physical file path for this data object if the normal resource vault is not used.
    FORCE_FLAG_KW - overwrite existing copy. This keyWd has no value
[out]openStat- Pointer to a openStat_t containing the stat of the just created object.
Returns
integer
Return values
anopened object descriptor on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 71 of file rcDataObjCreateAndStat.cpp.

References DATA_OBJ_CREATE_AND_STAT_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by rsDataObjCreate().

Here is the call graph for this function:

◆ rcDataObjGet()

rcDataObjGet ( rcComm_t conn,
dataObjInp_t dataObjInp,
char *  locFilePath 
)
Description:\n Get (download) a data object from iRODS.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Get (download) a data object /myZone/home/john/myfile:
dataObjInp_t dataObjInp;
char locFilePath[MAX_NAME_LEN];
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
rstrcpy (locFilePath, "./mylocalfile", MAX_NAME_LEN);
dataObjInp.dataSize = 0;
status = rcDataObjGet (conn, &dataObjInp, locFilePath);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • int numThreads - the number of threads to use. Valid values are:
    NO_THREADING (-1) - no multi-thread
    0 - the server will decide the number of threads. (recommended setting).
    A positive integer - specifies the number of threads.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    RESC_NAME_KW - The resource of the data object to open.
    REPL_NUM_KW - the replica number of the copy to open.
    FORCE_FLAG_KW - overwrite existing local copy. This keyWd has no value.
    VERIFY_CHKSUM_KW - verify the checksum value of the local file after the download. This keyWd has no value.
    RBUDP_TRANSFER_KW - use RBUDP for data transfer. This keyWd has no value
    RBUDP_SEND_RATE_KW - the number of RBUDP packet to send per second The default is 600000.
    RBUDP_PACK_SIZE_KW - the size of RBUDP packet. The default is 8192.
    LOCK_TYPE_KW - set advisory lock type. valid value - WRITE_LOCK_TYPE.
[in]locFilePath- the path of the local file to download. This path can be a relative path.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 91 of file rcDataObjGet.cpp.

References _rcDataObjGet(), BytesBuf::buf, portalOprOut::chksum, clearLfRestartFile(), DataObjInp::condInput, portList_t::cookie, irods::CS_NEG_USE_SSL(), DataObjInp::dataSize, rcComm_t::fileRestart, FORCE_FLAG_KW, getFile(), getFileFromPortal(), getFileToPortalRbudp(), getIncludeFile(), getRodsEnv(), getUdpPortFromPortList(), getValByKey(), portList_t::hostAddr, fileRestart_t::info, portalOprOut::l1descInx, BytesBuf::len, LOG_ERROR, rcComm_t::negotiation_results, NO_THREADING, NULL, fileRestartInfo_t::numSeg, DataObjInp::numThreads, portalOprOut::numThreads, transferStat_t::numThreads, DataObjInp::objPath, OVERWRITE_WITHOUT_FORCE_FLAG, portalOprOut::portList, portList_t::portNum, rcOprComplete(), rodsLog(), rodsLogError(), irods.pypyodbc::status, STDOUT_FILE_NAME, SYS_INVALID_PORTAL_OPR, rcComm_t::transStat, USER_CHKSUM_MISMATCH, VERIFY_CHKSUM_KW, verifyChksumLocFile(), and VERY_VERBOSE_KW.

Referenced by getDataObjUtil(), rcDataObjRsync(), rcExecMyRule(), and rsyncDataToFileUtil().

Here is the call graph for this function:

◆ rcDataObjLock()

rcDataObjLock ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Lock a data object.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Lock and unlock a data object /myZone/home/john/myfile for write:
dataObjInp_t dataObjInp;
int lockFd;
char tmpStr[NAME_LEN];
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.openFlags = O_WRONLY;
addKeyVal (&dataObjInp.condInput, LOCK_TYPE_KW, WRITE_LOCK_TYPE);
# LOCK_CMD_KW input is optional. If not specified, SET_LOCK_WAIT_CMD is assumed
lockFd = rcDataObjLock (conn, &dataObjInp);
if (lockFd < 0) {
.... handle the error
}
# now unlock it
addKeyVal (&dataObjInp.condInput, LOCK_TYPE_KW, UNLOCK_TYPE);
snprintf (tmpStr, NAME_LEN, "%-d", lockFd);
addKeyVal (&dataObjInp.condInput, LOCK_FD_KW, tmpStr);
status = rcDataObjLock (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    LOCK_TYPE_KW - the lock type. Valid values are READ_LOCK_TYPE, WRITE_LOCK_TYPE and UNLOCK_TYPE.
    LOCK_CMD_KW - the lock command. Valid values are SET_LOCK_CMD, SET_LOCK_WAIT_CMD and GET_LOCK_CMD.
    LOCK_FD_KW - the file desc of the locked file. Needed only for UNLOCK_TYPE.
Returns
integer
Return values
anopened and locked file descriptor for READ_LOCK_TYPE, WRITE_LOCK_TYPE or 0 for UNLOCK_TYPE on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 71 of file rcDataObjLock.cpp.

References DATA_OBJ_LOCK_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by rsDataObjLock().

Here is the call graph for this function:

◆ rcDataObjLseek()

rcDataObjLseek ( rcComm_t conn,
openedDataObjInp_t dataObjLseekInp,
fileLseekOut_t **  dataObjLseekOut 
)
Description:\n Repositions the offset of the open file associated
with the file descriptor to the argument offset according to the directive whence. This is equivalent to lseek of UNIX.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Advance the offset 12345 bytes from current position of an open data object:
int status;
dataObjInp_t dataObjInp;
openedDataObjInp_t dataObjLseekInp;
fileLseekOut_t *dataObjLseekOut = NULL;
bzero (&dataObjInp, sizeof (dataObjInp));
bzero (&dataObjLseekInp, sizeof (dataObjLseekInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.openFlags = O_RDONLY;
dataObjLseekInp.l1descInx = rcDataObjOpen (conn, &dataObjInp);
if (dataObjLseekInp.l1descInx < 0) {
.... handle the error
}
dataObjLseekInp.offset = 12345;
dataObjLseekInp.whence = SEEK_CUR;
status = rcDataObjLseek (conn, &dataObjLseekInp, &dataObjLseekOut);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjLseekInp- Elements of openedDataObjInp_t used :
  • int l1descInx - the opened data object descriptor from rcDataObjOpen or rcDataObjCreate.
  • int whence - Similar to lseek of UNIX. Valid values are:
    SEEK_SET - The offset is set to offset bytes.
    SEEK_CUR - The offset is set to its current location plus offset bytes.
    SEEK_END - The offset is set to the size of the file plus offset bytes.
  • rodsLong offset - the offset.
[out]dataObjLseekOut- pointer to a fileLseekOut_t containing the resulting offset location in bytes from the beginning of the file.
Returns
integer
Return values
0on success.
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 77 of file rcDataObjLseek.cpp.

References DATA_OBJ_LSEEK_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by lfRestartGetWithInfo(), lfRestartPutWithInfo(), and rsDataObjLseek().

Here is the call graph for this function:

◆ rcDataObjOpen()

rcDataObjOpen ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Open a data object. This is equivalent to open of UNIX.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Open a data object /myZone/home/john/myfile in myRescource for write:
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.openFlags = O_WRONLY;
addKeyVal (&dataObjInp.condInput, RESC_NAME_KW, "myRescource");
status = rcDataObjOpen (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • int openFlags - the open flags. valid open flags are: O_RDONLY, O_WRONLY, O_RDWR and O_TRUNC.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    DATA_TYPE_KW - the data type of the data object.
    RESC_NAME_KW - The resource of the data object to open.
    REPL_NUM_KW - the replica number of the copy to open.
    LOCK_TYPE_KW - set advisory lock type. valid values - WRITE_LOCK_TYPE or READ_LOCK_TYPE.
Returns
integer
Return values
anopened object descriptor on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 67 of file rcDataObjOpen.cpp.

References DATA_OBJ_OPEN_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by catDataObj(), lfRestartGetWithInfo(), and lfRestartPutWithInfo().

Here is the call graph for this function:

◆ rcDataObjOpenAndStat()

rcDataObjOpenAndStat ( rcComm_t conn,
dataObjInp_t dataObjInp,
openStat_t **  openStat 
)
Description:\n Open a data object. This API is the same as
the rcDataObjOpen API except an additional openStat_t struct containing the stat of the just opened object is returned.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Open a data object /myZone/home/john/myfile in myRescource for write:
dataObjInp_t dataObjInp;
openStat_t *openStat = NULL;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.openFlags = O_WRONLY;
addKeyVal (&dataObjInp.condInput, RESC_NAME_KW, "myRescource");
status = rcDataObjOpenAndStat (conn, &dataObjInp, &openStat);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • int openFlags - the open flags. valid open flags are: O_RDONLY, O_WRONLY, O_RDWR and O_TRUNC.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    DATA_TYPE_KW - the data type of the data object.
    RESC_NAME_KW - The resource of the data object to open.
    REPL_NUM_KW - the replica number of the copy to open.
[out]openStat- Pointer to a openStat_t containing the stat of the just opened object.
Returns
integer
Return values
anopened object descriptor on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 69 of file rcDataObjOpenAndStat.cpp.

References DATA_OBJ_OPEN_AND_STAT_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by rsDataObjOpen().

Here is the call graph for this function:

◆ rcDataObjPhymv()

rcDataObjPhymv ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Physically move a data object in iRODS from one resource to
another storage resource.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Phymv a data object /myZone/home/john/myfile to myRescource:
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
addKeyVal (&dataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcDataObjPhymv (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • int numThreads - the number of threads to use. Valid values are:
    NO_THREADING (-1) - no multi-thread
    0 - the server will decide the number of threads. (recommanded setting).
    A positive integer - specifies the number of threads.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    REPL_NUM_KW - the replica number of the copy to phymv.
    RESC_NAME_KW - the source resource for the phymv.
    DEST_RESC_NAME_KW - The target resource for the phymv.
    ADMIN_KW - admin user phymove other users files. This keyWd has no value.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 68 of file rcDataObjPhymv.cpp.

References _rcDataObjPhymv(), NULL, DataObjInp::oprType, PHYMV_OPR, irods.pypyodbc::status, and rcComm_t::transStat.

Referenced by phymvDataObjUtil().

Here is the call graph for this function:

◆ rcDataObjPut()

rcDataObjPut ( rcComm_t conn,
dataObjInp_t dataObjInp,
char *  locFilePath 
)
Description:\n Put (upload) a data object to iRODS.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Put (upload) a data object /myZone/home/john/myfile in myRescource:
dataObjInp_t dataObjInp;
char locFilePath[MAX_NAME_LEN];
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
rstrcpy (locFilePath, "./mylocalfile", MAX_NAME_LEN);
dataObjInp.createMode = 0750;
dataObjInp.dataSize = 12345;
addKeyVal (&dataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcDataObjPut (conn, &dataObjInp, locFilePath);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • int createMode - the file mode of the data object.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • int numThreads - the number of threads to use. Valid values are:
    NO_THREADING (-1) - no multi-thread
    0 - the server will decide the number of threads. (recommanded setting).
    A positive integer - specifies the number of threads.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    DATA_TYPE_KW - the data type of the data object.
    DEST_RESC_NAME_KW - The resource to store this data object
    FILE_PATH_KW - The physical file path for this data object if the normal resource vault is not used.
    FORCE_FLAG_KW - overwrite existing copy. This keyWd has no value
    ALL_KW - upload to all resources in the resource group if the input resource (via DEST_RESC_NAME_KW) is a resource group. This keyWd has no value.
    REPL_NUM_KW - If the data object already exist, the replica number of the copy to overwrite.
    REG_CHKSUM_KW - register the target checksum value after the copy. The value is the md5 checksum value of the local file.
    VERIFY_CHKSUM_KW - verify and register the target checksum value after the copy. The value is the md5 checksum value of the local file.
    RBUDP_TRANSFER_KW - use RBUDP for data transfer. This keyWd has no value.
    RBUDP_SEND_RATE_KW - the number of RBUDP packet to send per second The default is 600000.
    RBUDP_PACK_SIZE_KW - the size of RBUDP packet. The default is 8192.
    LOCK_TYPE_KW - set advisory lock type. valid value - WRITE_LOCK_TYPE.
[in]locFilePath- the path of the local file to upload. This path can be a relative path.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 100 of file rcDataObjPut.cpp.

References _rcDataObjPut(), addKeyVal(), clearBBuf(), clearLfRestartFile(), DataObjInp::condInput, portList_t::cookie, irods::CS_NEG_USE_SSL(), DATA_INCLUDED_KW, DataObjInp::dataSize, rcComm_t::fileRestart, fillBBufWithFile(), getFileSize(), getRodsEnv(), getUdpPortFromPortList(), getValByKey(), portList_t::hostAddr, fileRestart_t::info, rodsEnv::irodsDefaultNumberTransferThreads, rodsEnv::irodsMaxSizeForSingleBuffer, portalOprOut::l1descInx, LOG_ERROR, LOG_NOTICE, rcComm_t::negotiation_results, NULL, fileRestartInfo_t::numSeg, portalOprOut::numThreads, transferStat_t::numThreads, DataObjInp::objPath, DataObjInp::oprType, portalOprOut::portList, portList_t::portNum, PUT_OPR, putFile(), putFileToPortal(), putFileToPortalRbudp(), rcOprComplete(), rmKeyVal(), rodsLog(), irods.pypyodbc::status, SYS_INVALID_PORTAL_OPR, rcComm_t::transStat, USER_FILE_DOES_NOT_EXIST, and VERY_VERBOSE_KW.

Referenced by putFileUtil(), rcDataObjRsync(), rcExecMyRule(), and rsyncFileToDataUtil().

Here is the call graph for this function:

◆ rcDataObjRead()

rcDataObjRead ( rcComm_t conn,
openedDataObjInp_t dataObjReadInp,
bytesBuf_t dataObjReadOutBBuf 
)
Description:\n Read a chunk of data from an opened data object.
This is equivalent to read of UNIX.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Read 12345 bytes from an open a data object:
dataObjInp_t dataObjInp;
openedDataObjInp_t dataObjReadInp;
bytesBuf_t dataObjReadOutBBuf;
int bytesRead;
bzero (&dataObjInp, sizeof (dataObjInp));
bzero (&dataObjReadInp, sizeof (dataObjReadInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.openFlags = O_RDONLY;
dataObjReadInp.l1descInx = rcDataObjOpen (conn, &dataObjInp);
if (dataObjReadInp.l1descInx < 0) {
.... handle the error
}
bzero (&dataObjReadOutBBuf, sizeof (dataObjReadOutBBuf));
dataObjReadInp.len = 12345;
bytesRead = rcDataObjRead (conn, &dataObjReadInp, &dataObjReadInpBBuf);
if (bytesRead < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjReadInp- Elements of openedDataObjInp_t used :
  • int l1descInx - the opened data object descriptor from rcDataObjOpen or rcDataObjCreate.
  • int len - the length to read
[out]dataObjReadOutBBuf- A pointer to a bytesBuf_t containing the data read.
Returns
integer
Return values
thenumber of bytes read on success.
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 69 of file rcDataObjRead.cpp.

References DATA_OBJ_READ_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by catDataObj(), getFile(), getSeg(), and rsDataObjRead().

Here is the call graph for this function:

◆ rcDataObjRename()

rcDataObjRename ( rcComm_t conn,
dataObjCopyInp_t dataObjRenameInp 
)
Description:\n Rename an iRODS path. The iRODS path can be a data object or a
collection. This is equivalent to rename of UNIX.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Rename an iRODS path /myZone/home/john/mypathA to /myZone/home/john/mypathB and store in myRescource:
dataObjCopyInp_t dataObjRenameInp;
bzero (&dataObjRenameInp, sizeof (dataObjRenameInp));
rstrcpy (dataObjRenameInp.destDataObjInp.objPath, "/myZone/home/john/mypathB", MAX_NAME_LEN);
rstrcpy (dataObjRenameInp.srcDataObjInp.objPath, "/myZone/home/john/mypathA", MAX_NAME_LEN);
status = rcDataObjRename (conn, &dataObjRenameInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjRenameInp- Elements of dataObjCopyInp_t used :
  • char srcDataObjInp.objPath[MAX_NAME_LEN] - full path of the source path.
  • char destDataObjInp.objPath[MAX_NAME_LEN] - full path of the target path.
  • int srcDataObjInp.oprType - The operation type. Valid values are:
    RENAME_DATA_OBJ - rename a data object.
    RENAME_COLL - rename a collection.
    0 - The object type is unknown. Just rename it.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 68 of file rcDataObjRename.cpp.

References DATA_OBJ_RENAME_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by mvObjUtil(), and rsDataObjRename().

Here is the call graph for this function:

◆ rcDataObjRepl()

rcDataObjRepl ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Replicate a data object to another resource.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Replicate a data object /myZone/home/john/myfile to myRescource:
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
addKeyVal (&dataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcDataObjRepl (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • int createMode - the file mode of the data object.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • int numThreads - the number of threads to use. Valid values are:
    NO_THREADING (-1) - no multi-thread
    0 - the server will decide the number of threads. (recommanded setting).
    A positive integer - specifies the number of threads.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    REPL_NUM_KW - The replica number of the copy to be used as source.
    RESC_NAME_KW - The copy stored in this resource to be used as source.
    DEST_RESC_NAME_KW - The resource to store the new replica.
    BACKUP_RESC_NAME_KW - The resource to store the new replica. In backup mode. If a good copy already exists in this resource group or resource, don't make another one.
    ALL_KW - replicate to all resources in the resource group if the input resource (via DEST_RESC_NAME_KW) is a resource group. This keyWd has no value.
    ADMIN_KW - admin user backup/replicate other user's files. This keyWd has no value.
    FILE_PATH_KW - The physical file path for this data object if the normal resource vault is not used.
    RBUDP_TRANSFER_KW - use RBUDP for data transfer. This keyWd has no value.
    RBUDP_SEND_RATE_KW - the number of RBUDP packet to send per second The default is 600000.
    RBUDP_PACK_SIZE_KW - the size of RBUDP packet. The default is 8192.
    LOCK_TYPE_KW - set advisory lock type. valid value - READ_LOCK_TYPE.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 84 of file rcDataObjRepl.cpp.

References _rcDataObjRepl(), NULL, DataObjInp::oprType, REPLICATE_OPR, irods.pypyodbc::status, and rcComm_t::transStat.

Referenced by replDataObjUtil().

Here is the call graph for this function:

◆ rcDataObjRsync()

rcDataObjRsync ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Synchronize an iRODS data object with a local file or with another
data object.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Synchronize a data object /myZone/home/john/myfileA to another data object /myZone/home/john/myfileB and put the new data object in resource myRescource:
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfileA", MAX_NAME_LEN);
addKeyVal (&dataObjInp.condInput, RSYNC_MODE_KW, IRODS_TO_IRODS);
addKeyVal (&dataObjInp.condInput, RSYNC_DEST_PATH_KW, "/myZone/home/john/myfileB");
addKeyVal (&dataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcDataObjRsync (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - For LOCAL_TO_IRODS or IRODS_TO_LOCAL modes, this is the iRODS data object path. For IRODS_TO_IRODS mode, this is the source path.
  • int createMode - the file mode of the data object. Meaningful only for LOCAL_TO_IRODS mode.
  • rodsLong_t dataSize - the size of the data object. Input 0 if not known.
  • int numThreads - the number of threads to use. Valid values are:
    NO_THREADING (-1) - no multi-thread
    0 - the server will decide the number of threads. (recommanded setting).
    A positive integer - specifies the number of threads.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    RSYNC_MODE_KW - The mode of the Synchronization. Valid modes are: LOCAL_TO_IRODS - synchronize from a local file to a iRODS data object. IRODS_TO_LOCAL - synchronize from a iRODS data object to a local file. IRODS_TO_IRODS - synchronize from a iRODS data object to a iRODS data object..
    RSYNC_DEST_PATH_KW - For LOCAL_TO_IRODS or IRODS_TO_LOCAL modes, this is the local file path. For IRODS_TO_IRODS mode, this is the target path.
    RSYNC_CHKSUM_KW - The md5 checksum value of the local file. valid only for LOCAL_TO_IRODS or IRODS_TO_LOCAL modes.
    DEST_RESC_NAME_KW - The resource to store the new data object. Valid only for LOCAL_TO_IRODS or IRODS_TO_IRODS modes.
    ALL_KW - replicate to all resources in the resource group if the input resource (via DEST_RESC_NAME_KW) is a resource group. This keyWd has no value. Valid only for LOCAL_TO_IRODS or IRODS_TO_IRODS modes.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 92 of file rcDataObjRsync.cpp.

References _rcDataObjRsync(), branchReadAndProcApiReply(), CL_GET_ACTION, CL_PUT_ACTION, CL_ZONE_OPR_INX, clearKeyVal(), clearMsParamArray(), DataObjInp::condInput, DATA_OBJ_RSYNC_AN, getMsParamByLabel(), getValByKey(), MsParam::inOutStruct, LOG_DEBUG, NULL, rcDataObjGet(), rcDataObjPut(), rcOprComplete(), rodsLogError(), RSYNC_DEST_PATH_KW, irods.pypyodbc::status, SYS_RSYNC_TARGET_MODIFIED, SYS_SVR_TO_CLI_GET_ACTION, SYS_SVR_TO_CLI_MSI_NO_EXIST, SYS_SVR_TO_CLI_MSI_REQUEST, SYS_SVR_TO_CLI_PUT_ACTION, USER_FILE_DOES_NOT_EXIST, and USER_INPUT_PATH_ERR.

Referenced by rsyncDataToDataUtil(), rsyncDataToFileUtil(), and rsyncFileToDataUtil().

Here is the call graph for this function:

◆ rcDataObjTrim()

rcDataObjTrim ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Trim down the number of replica of a data object by deleting some
replicas.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Trim the data object /myZone/home/john/myfile by deleting replica in myRescource and with age greater than 600 minutes (10 hours). Also keep a minimium of 1 copy of the data after the trim :
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
addKeyVal (&dataObjInp->condInput, COPIES_KW, "1");
addKeyVal (&dataObjInp->condInput, AGE_KW, "600");
addKeyVal (&dataObjInp.condInput, RESC_NAME_KW, "myRescource");
status = rcDataObjTrim (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    COPIES_KW - the minimum number of current replicas to keep. The replicas will be deleted according to input instruction but the remaining won't go below this value. If not specified, the default value is 2.
    ADMIN_KW - admin user trims other user's files. This keyWd has no value.
    REPL_NUM_KW - The replica number of the replica to delete.
    RESC_NAME_KW - delete replica stored in this resource.
    AGE_KW - specifiies the age in minutes. Only delete replicas with age greater than this value.
    DRYRUN_KW - Do a dry run. No copy will actually be trimmed. This keyWd has no value.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 73 of file rcDataObjTrim.cpp.

References DATA_OBJ_TRIM_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by rsDataObjTrim(), and trimDataObjUtil().

Here is the call graph for this function:

◆ rcDataObjTruncate()

rcDataObjTruncate ( rcComm_t conn,
dataObjInp_t dataObjInp 
)
Description:\n Truncate a data object to the specified size and register the
new size with iCAT. The old checksum value associated with the the data object will be cleared.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Truncate size the data object /myZone/home/john/myfile to 12345.
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.dataSize = 12345;
status = rcDataObjTruncate (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • rodsLong_t dataSize - the new size of the data object.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 56 of file rcDataObjTruncate.cpp.

References DATA_OBJ_TRUNCATE_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by rsDataObjTruncate().

Here is the call graph for this function:

◆ rcDataObjUnlink()

rcDataObjUnlink ( rcComm_t conn,
dataObjInp_t dataObjUnlinkInp 
)
Description:\n Unlink/delete a data object if the "forceFlag" is set. Otherwise,
move the data object to trash.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Unlink the data object /myZone/home/john/myfile
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
addKeyVal (&dataObjInp->condInput, FORCE_FLAG_KW, "");
status = rcDataObjUnlink (conn, &dataObjInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjUnlinkInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • char oprType - 0 normally.When set to UNREG_OPR, the data object is unregistered but the physical file is not deleted.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    FORCE_FLAG_KW - delete the data object. If it is not set, the data object is moved to trash. This keyWd has no value.
    REPL_NUM_KW - The replica number of the replica to delete.
    RESC_NAME_KW - delete replica stored in this resource.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 63 of file rcDataObjUnlink.cpp.

References DATA_OBJ_UNLINK_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by rmDataObjUtil(), rmtrashDataObjUtil(), rsDataObjUnlink(), and setStateForResume().

Here is the call graph for this function:

◆ rcDataObjWrite()

rcDataObjWrite ( rcComm_t conn,
openedDataObjInp_t dataObjWriteInp,
bytesBuf_t dataObjWriteInpBBuf 
)
Description:\n Write a chunk of data to an opened data object.
This is equivalent to write of UNIX.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Write 12345 bytes from an open a data object:
dataObjInp_t dataObjInp;
openedDataObjInp_t dataObjWriteInp;
bytesBuf_t dataObjWriteInpBBuf;
int bytesWrite;
bzero (&dataObjInp, sizeof (dataObjInp));
bzero (&dataObjWriteInp, sizeof (dataObjWriteInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
dataObjInp.createMode = 0750;
dataObjInp.dataSize = 12345;
dataObjInp.openFlags = O_WRONLY;
addKeyVal (&dataObjInp.condInput, DEST_RESC_NAME_KW, "myRescource");
dataObjWriteInp.l1descInx = rcDataObjCreate (conn, &dataObjInp);
if (dataObjWriteInp.l1descInx < 0) {
.... handle the error
}
bzero (&dataObjWriteInpBBuf, sizeof (dataObjWriteInpBBuf));
dataObjWriteInp.len = 12345;
dataObjWriteInp.buf = malloc (12345);
if (dataObjWriteInp.buf == NULL) {
.... handle the error
} else {
copy date to dataObjWriteInp.buf
}
bytesWrite = rcDataObjWrite (conn, &dataObjWriteInp, &dataObjWriteInpBBuf);
if (bytesWrite < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjWriteInp- Elements of openedDataObjInp_t used :
  • int l1descInx - the opened data object descriptor from rcDataObjOpen or rcDataObjCreate.
  • int len - the length to write
[in]dataObjWriteInpBBuf- A pointer to a bytesBuf_t containing the data to write.
Returns
integer
Return values
thenumber of bytes write on success.
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 79 of file rcDataObjWrite.cpp.

References DATA_OBJ_WRITE_AN, NULL, procApiRequest(), and irods.pypyodbc::status.

Referenced by putFile(), putSeg(), and rsDataObjWrite().

Here is the call graph for this function:

◆ rcObjStat()

rcObjStat ( rcComm_t conn,
dataObjInp_t dataObjInp,
rodsObjStat_t **  rodsObjStatOut 
)
Description:\n Return information about an iRODS path. This path can be a data objection or
a collection. This call returns a rodsObjStat_t structure containing the information. This is equivalent to stat of UNIX.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Get information on an iRODS path /myZone/home/john/myfile:
dataObjInp_t dataObjInp;
rodsObjStat_t *rodsObjStatOut = NULL;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
status = rcObjStat (conn, &dataObjInp, &rodsObjStatOut);
if (status < 0) {
.... handle the error
}
# process the info contained in rodsObjStatOut and the free it.
......
freeRodsObjStat (rodsObjStatOut);
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]dataObjInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the object. The path can be a data object or a collection.
[out]rodsObjStatOut- Pointer to a rodsObjStat_t containing information on the data object or collection.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 65 of file rcObjStat.cpp.

References NULL, OBJ_STAT_AN, procApiRequest(), and irods.pypyodbc::status.

Referenced by getRodsObjType(), rclOpenCollection(), rsObjStat(), and trimDataObjUtil().

Here is the call graph for this function:

◆ rcPhyPathReg()

rcPhyPathReg ( rcComm_t conn,
dataObjInp_t phyPathRegInp 
)
Description:\n Register a physical file into iRODS as a data object.
The file must already exist on the server where the input resource is located.
Primary User:\n client
Since
1.0
Remarks
none
Note
none
Example Usage:\n
Register a UNIX file /data/john/myfile as an iRODS data object /myZone/home/john/myfile. This file is located on the same server as "myRescource" resource:
dataObjInp_t phyPathRegInp;
bzero (&phyPathRegInp, sizeof (phyPathRegInp));
rstrcpy (phyPathRegInp.objPath, "/myZone/home/john/myfile", MAX_NAME_LEN);
addKeyVal (&phyPathRegInp.condInput, FILE_PATH_KW, "/data/john/myfile");
addKeyVal (&phyPathRegInp.condInput, DEST_RESC_NAME_KW, "myRescource");
status = rcPhyPathReg (conn, &phyPathRegInp);
if (status < 0) {
.... handle the error
}
Parameters
[in]conn- A rcComm_t connection handle to the server.
[in]phyPathRegInp- Elements of dataObjInp_t used :
  • char objPath[MAX_NAME_LEN] - full path of the data object.
  • keyValPair_t condInput - keyword/value pair input. Valid keywords:
    FILE_PATH_KW - The physical file path of this data object. The server UNIX user (the UNIX user that runs the server) must have read/write access to this file.
    DATA_TYPE_KW - the data type of the data object.
    DEST_RESC_NAME_KW - The resource where the physical file is located.
    REG_REPL_KW - The file is registered as a replica of an existing data object.
    REG_CHKSUM_KW - register the given checksum value with the iCAT.
    VERIFY_CHKSUM_KW - calculate the checksum of the file on the iRODS server and register the value with the iCAT. This keyWd has no value.
Returns
integer
Return values
0on success
Side Effect:\n none
Precondition
none
Postcondition
none
See also
none

Definition at line 71 of file rcPhyPathReg.cpp.

References NULL, PHY_PATH_REG_AN, procApiRequest(), and irods.pypyodbc::status.

Referenced by mcollUtil(), regUtil(), and remotePhyPathReg().

Here is the call graph for this function: