iRODS/clients/icommands/src/icd.cpp
int
checkColl( rcComm_t *Conn, char *path ) {
    genQueryInp_t genQueryInp;
    genQueryOut_t *genQueryOut;
    int i1a[10];
    int i1b[10];
    int i2a[10];
    char *condVal[2];
    char v1[MAX_NAME_LEN];
    int status;

    memset( &genQueryInp, 0, sizeof( genQueryInp_t ) );

    i1a[0] = COL_COLL_ID;
    i1b[0] = 0; /* currently unused */
    genQueryInp.selectInp.inx = i1a;
    genQueryInp.selectInp.value = i1b;
    genQueryInp.selectInp.len = 1;

    i2a[0] = COL_COLL_NAME;
    genQueryInp.sqlCondInp.inx = i2a;
    sprintf( v1, "='%s'", path );
    condVal[0] = v1;
    genQueryInp.sqlCondInp.value = condVal;
    genQueryInp.sqlCondInp.len = 1;

    genQueryInp.maxRows = 10;
    genQueryInp.continueInx = 0;
    status = rcGenQuery( Conn, &genQueryInp, &genQueryOut );
    return status;
}
/* Check to see if a collection exists */
Check to see if a collection exists
Check to see if a collection exists
int
checkColl( rcComm_t *Conn, char *path ) {
    genQueryInp_t genQueryInp;
    genQueryOut_t *genQueryOut;
    int i1a[10];
    int i1b[10];
    int i2a[10];
    char *condVal[2];
    char v1[MAX_NAME_LEN];
    int status;
    memset( &genQueryInp, 0, sizeof( genQueryInp_t ) );
    i1a[0] = COL_COLL_ID;
    i1b[0] = 0; 
    genQueryInp.selectInp.inx = i1a;
    genQueryInp.selectInp.value = i1b;
    genQueryInp.selectInp.len = 1;
    i2a[0] = COL_COLL_NAME;
    genQueryInp.sqlCondInp.inx = i2a;
    sprintf( v1, "='%s'", path );
    condVal[0] = v1;
    genQueryInp.sqlCondInp.value = condVal;
    genQueryInp.sqlCondInp.len = 1;
    genQueryInp.maxRows = 10;
    genQueryInp.continueInx = 0;
    status = rcGenQuery( Conn, &genQueryInp, &genQueryOut );
    return status;
}
int checkColl ( rcComm_t * Conn , char * path ) { genQueryInp_t genQueryInp ; genQueryOut_t * genQueryOut ; int i1a [ 10 ] ; int i1b [ 10 ] ; int i2a [ 10 ] ; char * condVal [ 2 ] ; char v1 [ MAX_NAME_LEN ] ; int status ; memset ( & genQueryInp , 0 , sizeof ( genQueryInp_t ) ) ; i1a [ 0 ] = COL_COLL_ID ; i1b [ 0 ] = 0 ; genQueryInp . selectInp . inx = i1a ; genQueryInp . selectInp . value = i1b ; genQueryInp . selectInp . len = 1 ; i2a [ 0 ] = COL_COLL_NAME ; genQueryInp . sqlCondInp . inx = i2a ; sprintf ( v1 , " " , path ) ; condVal [ 0 ] = v1 ; genQueryInp . sqlCondInp . value = condVal ; genQueryInp . sqlCondInp . len = 1 ; genQueryInp . maxRows = 10 ; genQueryInp . continueInx = 0 ; status = rcGenQuery ( Conn , & genQueryInp , & genQueryOut ) ; return status ; }
Check to see if a collection exists
Check to see if a collection exists
/* currently unused */