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)  

rsStructFileExtAndReg.cpp
Go to the documentation of this file.
1 
3 /* rsStructFileExtAndReg.c. See structFileExtAndReg.h for a description of
4  * this API call.*/
5 
6 
7 #include "apiHeaderAll.h"
8 #include "objMetaOpr.hpp"
9 #include "collection.hpp"
10 #include "dataObjOpr.hpp"
11 #include "resource.hpp"
12 #include "specColl.hpp"
13 #include "physPath.hpp"
14 #include "objStat.h"
15 #include "miscServerFunct.hpp"
16 #include "fileOpr.hpp"
17 #include "rcGlobalExtern.h"
19 #include "structFileExtAndReg.h"
20 #include "rodsGenQuery.h"
21 #include "rodsType.h"
22 #include "rsDataObjOpen.hpp"
23 #include "rsDataObjClose.hpp"
24 #include "rsModDataObjMeta.hpp"
25 #include "rsPhyBundleColl.hpp"
26 #include "rsRegDataObj.hpp"
28 
29 // =-=-=-=-=-=-=-
31 #include "irods_stacktrace.hpp"
33 #include "irods_file_object.hpp"
34 #include "irods_random.hpp"
35 
36 #include <boost/filesystem/operations.hpp>
37 #include <boost/filesystem/convenience.hpp>
38 using namespace boost::filesystem;
39 
40 int
42  rsComm_t *rsComm,
43  const char*,
44  const std::string& rescHier,
45  char *collection,
46  char *phyBunDir,
47  int flags,
48  genQueryOut_t *attriArray );
49 
51  rsComm_t *rsComm,
52  const dataObjInfo_t& _dataObjInfo,
53  char *collection,
54  char *phyBunDir,
55  int flags,
56  genQueryOut_t *attriArray );
57 
58 int
60  rsComm_t *rsComm,
61  const dataObjInfo_t& _dataObjInfo,
62  char *subObjPath,
63  char *subfilePath,
64  const rodsLong_t dataSize,
65  int flags );
66 
67 int
69  rsComm_t *rsComm,
70  structFileExtAndRegInp_t *structFileExtAndRegInp ) {
71  int status;
72  dataObjInp_t dataObjInp;
73  int l1descInx;
74  int remoteFlag;
76  char phyBunDir[MAX_NAME_LEN];
77  int flags = 0;
78 
79  specCollCache_t *specCollCache = NULL;
80 
81  resolveLinkedPath( rsComm, structFileExtAndRegInp->objPath, &specCollCache,
82  &structFileExtAndRegInp->condInput );
83 
84  resolveLinkedPath( rsComm, structFileExtAndRegInp->collection,
85  &specCollCache, NULL );
86 
87  if ( !isSameZone( structFileExtAndRegInp->objPath,
88  structFileExtAndRegInp->collection ) ) {
90  }
91 
92  memset( &dataObjInp, 0, sizeof( dataObjInp ) );
93  rstrcpy( dataObjInp.objPath, structFileExtAndRegInp->objPath,
94  MAX_NAME_LEN );
95 
96  /* replicate the condInput. may have resource input */
97  replKeyVal( &structFileExtAndRegInp->condInput, &dataObjInp.condInput );
98  dataObjInp.openFlags = O_RDONLY;
99 
100  remoteFlag = getAndConnRemoteZone( rsComm, &dataObjInp, &rodsServerHost,
101  REMOTE_OPEN );
102 
103  if ( remoteFlag < 0 ) {
104  return remoteFlag;
105  }
106  else if ( remoteFlag == REMOTE_HOST ) {
108  structFileExtAndRegInp );
109  return status;
110  }
111 
112  // =-=-=-=-=-=-=-
113  // working on the "home zone", determine if we need to redirect to a different
114  // server in this zone for this operation. if there is a RESC_HIER_STR_KW then
115  // we know that the redirection decision has already been made
116  std::string hier;
117  int local = LOCAL_HOST;
118  rodsServerHost_t* host = 0;
119  if ( getValByKey( &dataObjInp.condInput, RESC_HIER_STR_KW ) == NULL ) {
121  &dataObjInp, hier, host, local );
122  if ( !ret.ok() ) {
123  std::stringstream msg;
124  msg << "rsStructFileExtAndReg :: failed in irods::resource_redirect for [";
125  msg << dataObjInp.objPath << "]";
126  irods::error pass_err = PASSMSG( msg.str(), ret );
127  irods::log( pass_err );
128 
129  if ( CAT_NO_ROWS_FOUND == pass_err.code() ) {
130  char* resc_name_kw = getValByKey( &dataObjInp.condInput, RESC_NAME_KW );
131  std::string msg( structFileExtAndRegInp->objPath );
132  msg += " does not exist";
133  if ( resc_name_kw ) {
134  msg += " or is not a replica on the target resource [";
135  msg += resc_name_kw;
136  msg += "]";
137  }
138  addRErrorMsg(
139  &rsComm->rError,
141  msg.c_str() );
142  ret.code( REPLICA_NOT_IN_RESC ); // repave to be real error
143  }
144  else if ( SYS_RESC_DOES_NOT_EXIST == pass_err.code() ) {
145  char* resc_name_kw = getValByKey( &dataObjInp.condInput, RESC_NAME_KW );
146  std::string msg( structFileExtAndRegInp->objPath );
147  msg += " resource does not exist ";
148  if ( resc_name_kw ) {
149  msg += "[";
150  msg += resc_name_kw;
151  msg += "]";
152  }
153  addRErrorMsg(
154  &rsComm->rError,
156  msg.c_str() );
157 
158  }
159  else {
160  addRErrorMsg(
161  &rsComm->rError,
162  pass_err.code(),
163  pass_err.result().c_str() );
164  }
165 
166  return ret.code();
167  }
168 
169  // =-=-=-=-=-=-=-
170  // we resolved the redirect and have a host, set the hier str for subsequent
171  // api calls, etc.
172  addKeyVal( &dataObjInp.condInput, RESC_HIER_STR_KW, hier.c_str() );
173 
174  } // if keyword
175 
176  /* open the structured file */
177  addKeyVal( &dataObjInp.condInput, NO_OPEN_FLAG_KW, "" );
178  l1descInx = rsDataObjOpen( rsComm, &dataObjInp );
179 
180  if ( l1descInx < 0 ) {
182  "rsStructFileExtAndReg: rsDataObjOpen of %s error. status = %d",
183  dataObjInp.objPath, l1descInx );
184  return l1descInx;
185  }
186 
187  openedDataObjInp_t dataObjCloseInp{};
188  dataObjCloseInp.l1descInx = l1descInx;
189 
190  if ( local == REMOTE_HOST ) {
191  addKeyVal( &structFileExtAndRegInp->condInput, RESC_NAME_KW, L1desc[l1descInx].dataObjInfo->rescName );
192 
193  status = rcStructFileExtAndReg( host->conn, structFileExtAndRegInp );
194  rsDataObjClose( rsComm, &dataObjCloseInp );
195 
196  return status;
197  }
198 
199  status = chkCollForExtAndReg( rsComm, structFileExtAndRegInp->collection, NULL );
200 
201  if ( status < 0 ) {
202  return status;
203  }
204 
205 
206  const auto dataObjInfo = L1desc[l1descInx].dataObjInfo;
207 
208  createPhyBundleDir( rsComm, dataObjInfo->filePath, phyBunDir, dataObjInfo->rescHier );
209 
210  status = unbunPhyBunFile( rsComm, dataObjInp.objPath, dataObjInfo->rescName, // JMC - backport 4657
211  dataObjInfo->filePath, phyBunDir, dataObjInfo->dataType, 0,
212  dataObjInfo->rescHier );
213 
215  /* rename the phyBunDir */
216  char tmp[MAX_NAME_LEN]; // JMC cppcheck - src & dst snprintf
217  strcpy( tmp, phyBunDir ); // JMC cppcheck - src & dst snprintf
218  snprintf( phyBunDir, MAX_NAME_LEN, "%s.%-u", tmp, irods::getRandom<unsigned int>() ); // JMC cppcheck - src & dst snprintf
219  status = unbunPhyBunFile( rsComm, dataObjInp.objPath, dataObjInfo->rescName,
220  dataObjInfo->filePath, phyBunDir, dataObjInfo->dataType, 0,
221  dataObjInfo->rescHier );
222  }
223 
224  if ( status < 0 ) {
226  "rsStructFileExtAndReg:unbunPhyBunFile err for %s to dir %s.stat=%d",
227  dataObjInfo->filePath, phyBunDir, status );
228  rsDataObjClose( rsComm, &dataObjCloseInp );
229  return status;
230  }
231 
232  if ( getValByKey( &structFileExtAndRegInp->condInput, FORCE_FLAG_KW )
233  != NULL ) {
234  flags = flags | FORCE_FLAG_FLAG;
235  }
236  if ( getValByKey( &structFileExtAndRegInp->condInput, BULK_OPR_KW )
237  != NULL ) {
238 
239  status = bulkRegUnbunSubfiles( rsComm, dataObjInfo->rescName, dataObjInfo->rescHier,
240  structFileExtAndRegInp->collection, phyBunDir, flags, NULL );
241  }
242  else {
243  status = regUnbunSubfiles( rsComm, *dataObjInfo,
244  structFileExtAndRegInp->collection, phyBunDir, flags, NULL );
245  }
246 
247  if ( status == CAT_NO_ROWS_FOUND ) {
248  /* some subfiles have been deleted. harmless */
249  status = 0;
250  }
251  else if ( status < 0 ) {
253  "_rsUnbunAndRegPhyBunfile: rsStructFileExtAndReg for dir %s.stat=%d",
254  phyBunDir, status );
255  }
256  rsDataObjClose( rsComm, &dataObjCloseInp );
257 
258  return status;
259 }
260 
261 int
262 chkCollForExtAndReg( rsComm_t *rsComm, char *collection,
263  rodsObjStat_t **rodsObjStatOut ) {
264  dataObjInp_t dataObjInp;
265  int status;
266  rodsObjStat_t *myRodsObjStat = NULL;
267 
268  bzero( &dataObjInp, sizeof( dataObjInp ) );
269  rstrcpy( dataObjInp.objPath, collection, MAX_NAME_LEN );
270  status = collStatAllKinds( rsComm, &dataObjInp, &myRodsObjStat );
271  if ( status < 0 ) {
272  status = rsMkCollR( rsComm, "/", collection );
273  if ( status < 0 ) {
275  "chkCollForExtAndReg: rsMkCollR of %s error. status = %d",
276  collection, status );
277  return status;
278  }
279  else {
280  status = collStatAllKinds( rsComm, &dataObjInp, &myRodsObjStat );
281  }
282  }
283 
284  if ( status < 0 || NULL == myRodsObjStat ) { // JMC cppcheck - nullptr
286  "chkCollForExtAndReg: collStat of %s error. status = %d",
287  dataObjInp.objPath, status );
288  return status;
289  }
290  else if ( myRodsObjStat->specColl != NULL &&
291  myRodsObjStat->specColl->collClass != MOUNTED_COLL ) {
292  /* only do mounted coll */
293  freeRodsObjStat( myRodsObjStat );
295  "chkCollForExtAndReg: %s is a struct file collection",
296  dataObjInp.objPath );
298  }
299 
300  if ( myRodsObjStat->specColl == NULL ) {
301  status = checkCollAccessPerm( rsComm, collection, ACCESS_DELETE_OBJECT );
302  }
303  else {
304  status = checkCollAccessPerm( rsComm,
305  myRodsObjStat->specColl->collection, ACCESS_DELETE_OBJECT );
306  }
307 
308  if ( status < 0 ) {
310  "chkCollForExtAndReg: no permission to write %s, status = %d",
311  collection, status );
312  freeRodsObjStat( myRodsObjStat );
313  }
314  else {
315  if ( rodsObjStatOut != NULL ) {
316  *rodsObjStatOut = myRodsObjStat;
317  }
318  else {
319  freeRodsObjStat( myRodsObjStat );
320  }
321  }
322  return status;
323 }
324 
325 /* regUnbunSubfiles - non bulk version of registering all files in phyBunDir
326  * to the collection. Valid values for flags are:
327  * FORCE_FLAG_FLAG.
328  */
329 int
330 regUnbunSubfiles( rsComm_t *rsComm, const dataObjInfo_t& _dataObjInfo,
331  char *collection, char *phyBunDir, int flags, genQueryOut_t *attriArray ) {
332  char subfilePath[MAX_NAME_LEN];
333  char subObjPath[MAX_NAME_LEN];
334  dataObjInp_t dataObjInp;
335  int status;
336  int savedStatus = 0;
337  rodsLong_t st_size;
338 
339  path srcDirPath( phyBunDir );
340  if ( !exists( srcDirPath ) || !is_directory( srcDirPath ) ) {
342  "regUnbunphySubfiles: opendir error for %s, errno = %d",
343  phyBunDir, errno );
344  return UNIX_FILE_OPENDIR_ERR - errno;
345  }
346  bzero( &dataObjInp, sizeof( dataObjInp ) );
347  directory_iterator end_itr; // default construction yields past-the-end
348  for ( directory_iterator itr( srcDirPath ); itr != end_itr; ++itr ) {
349  path p = itr->path();
350  snprintf( subfilePath, MAX_NAME_LEN, "%s",
351  p.c_str() );
352  if ( !exists( p ) ) {
354  "regUnbunphySubfiles: stat error for %s, errno = %d",
355  subfilePath, errno );
356  savedStatus = UNIX_FILE_STAT_ERR - errno;
357  unlink( subfilePath );
358  continue;
359  }
360  // =-=-=-=-=-=-=-
361  // JMC - backport 4833
362  if ( is_symlink( p ) ) {
364  "regUnbunSubfiles: %s is a symlink",
365  subfilePath );
366  savedStatus = SYMLINKED_BUNFILE_NOT_ALLOWED;
367  continue;
368  }
369  // =-=-=-=-=-=-=-
370  path childPath = p.filename();
371  snprintf( subObjPath, MAX_NAME_LEN, "%s/%s",
372  collection, childPath.c_str() );
373 
374  if ( is_directory( p ) ) {
375  status = rsMkCollR( rsComm, "/", subObjPath );
376  if ( status < 0 ) {
378  "regUnbunSubfiles: rsMkCollR of %s error. status = %d",
379  subObjPath, status );
380  savedStatus = status;
381  continue;
382  }
383  status = regUnbunSubfiles( rsComm, _dataObjInfo,
384  subObjPath, subfilePath, flags, attriArray );
385  if ( status < 0 ) {
387  "regUnbunSubfiles: regUnbunSubfiles of %s error. status=%d",
388  subObjPath, status );
389  savedStatus = status;
390  continue;
391  }
392  }
393  else if ( is_regular_file( p ) ) {
394  st_size = file_size( p );
395  status = regSubfile( rsComm, _dataObjInfo,
396  subObjPath, subfilePath, st_size, flags );
397  unlink( subfilePath );
398  if ( status < 0 ) {
400  "regUnbunSubfiles: regSubfile of %s error. status=%d",
401  subObjPath, status );
402  savedStatus = status;
403  continue;
404  }
405  }
406  }
407  rmdir( phyBunDir );
408  return savedStatus;
409 }
410 
411 int
412 regSubfile( rsComm_t *rsComm, const dataObjInfo_t& _dataObjInfo,
413  char *subObjPath, char *subfilePath, const rodsLong_t dataSize, int flags ) {
414  dataObjInfo_t dataObjInfo{};
415  dataObjInp_t dataObjInp{};
416  int modFlag = 0;
417 
418  rstrcpy( dataObjInp.objPath, subObjPath, MAX_NAME_LEN );
419  rstrcpy( dataObjInfo.objPath, subObjPath, MAX_NAME_LEN );
420  rstrcpy( dataObjInfo.rescName, _dataObjInfo.rescName, NAME_LEN );
421  rstrcpy( dataObjInfo.rescHier, _dataObjInfo.rescHier, MAX_NAME_LEN );
422  rstrcpy( dataObjInfo.dataMode, _dataObjInfo.dataMode, MAX_NAME_LEN );
423  rstrcpy( dataObjInfo.dataType, "generic", NAME_LEN );
424 
425  irods::error ret = resc_mgr.hier_to_leaf_id(dataObjInfo.rescHier,dataObjInfo.rescId);
426  if( !ret.ok() ) {
427  irods::log(PASS(ret));
428  }
429 
430 
431  dataObjInfo.dataSize = dataSize;
432  dataObjInfo.replStatus = 1;
433 
434  int status = getFilePathName( rsComm, &dataObjInfo, &dataObjInp );
435  if ( status < 0 ) {
437  "regSubFile: getFilePathName err for %s. status = %d",
438  dataObjInp.objPath, status );
439  return status;
440  }
441 
442  path p( dataObjInfo.filePath );
443  if ( exists( p ) ) {
444  if ( is_directory( p ) ) {
445  return SYS_PATH_IS_NOT_A_FILE;
446  }
447 
448  if ( chkOrphanFile( rsComm, dataObjInfo.filePath, _dataObjInfo.rescName,
449  &dataObjInfo ) > 0 ) {
450  /* an orphan file. just rename it */
451  fileRenameInp_t fileRenameInp;
452  bzero( &fileRenameInp, sizeof( fileRenameInp ) );
453  rstrcpy( fileRenameInp.oldFileName, dataObjInfo.filePath,
454  MAX_NAME_LEN );
455  char new_fn[ MAX_NAME_LEN ];
457  &fileRenameInp, 1, new_fn );
458  if ( status < 0 ) {
460  "regSubFile: renameFilePathToNewDir err for %s. status = %d",
461  fileRenameInp.oldFileName, status );
462  return status;
463  }
464  }
465  else {
466  /* not an orphan file */
467  if ( ( flags & FORCE_FLAG_FLAG ) != 0 && dataObjInfo.dataId > 0 &&
468  strcmp( dataObjInfo.objPath, subObjPath ) == 0 ) {
469  /* overwrite the current file */
470  modFlag = 1;
471  unlink( dataObjInfo.filePath );
472  }
473  else {
476  "regSubFile: phypath %s is already in use. status = %d",
477  dataObjInfo.filePath, status );
478  return status;
479  }
480  }
481  }
482  /* make the necessary dir */
484  rsComm,
485  0,
486  dataObjInfo.filePath,
487  dataObjInfo.rescHier,
488  getDefDirMode() );
489  if ( status ) {
490  rodsLog( LOG_ERROR, "mkDirForFilePath failed in regSubfile with status %d.", status );
491  return status;
492  }
493  /* add a link */
494 
495 #ifndef windows_platform /* Windows does not support link */
496  status = link( subfilePath, dataObjInfo.filePath );
497  if ( status < 0 ) {
499  "regSubFile: link error %s to %s. errno = %d",
500  subfilePath, dataObjInfo.filePath, errno );
501  return UNIX_FILE_LINK_ERR - errno;
502  }
503 #endif
504 
505  if ( modFlag == 0 ) {
506  status = svrRegDataObj( rsComm, &dataObjInfo );
507  // =-=-=-=-=-=-=-
508  // need to call modified under the covers for unbundle
509  // otherwise the resource hier is not properly notified
510  irods::file_object_ptr file_obj(
511  new irods::file_object(
512  rsComm,
513  &dataObjInfo ) );
514 
515  addKeyVal( (keyValPair_t*)&file_obj->cond_input(), OPEN_TYPE_KW, std::to_string(CREATE_TYPE).c_str() );
516 
517  irods::error ret = fileModified( rsComm, file_obj );
518  if ( !ret.ok() ) {
519  std::stringstream msg;
520  msg << " Failed to signal resource that the data object \"";
521  msg << dataObjInfo.objPath;
522  msg << " was modified.";
523  ret = PASSMSG( msg.str(), ret );
524  irods::log( ret );
525  status = ret.code();
526  }
527 
528  }
529  else {
530  char tmpStr[MAX_NAME_LEN];
531  modDataObjMeta_t modDataObjMetaInp;
532  keyValPair_t regParam;
533 
534  bzero( &modDataObjMetaInp, sizeof( modDataObjMetaInp ) );
535  bzero( &regParam, sizeof( regParam ) );
536  snprintf( tmpStr, MAX_NAME_LEN, "%lld", dataSize );
537  addKeyVal( &regParam, DATA_SIZE_KW, tmpStr );
538  addKeyVal( &regParam, ALL_REPL_STATUS_KW, tmpStr );
539  snprintf( tmpStr, MAX_NAME_LEN, "%d", ( int ) time( NULL ) );
540  addKeyVal( &regParam, DATA_MODIFY_KW, tmpStr );
541 
542  modDataObjMetaInp.dataObjInfo = &dataObjInfo;
543  modDataObjMetaInp.regParam = &regParam;
544 
545  // =-=-=-=-=-=-=-
546  // this path does call fileModified
547  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
548 
549  clearKeyVal( &regParam );
550  }
551 
552  if ( status < 0 ) {
554  "regSubFile: svrRegDataObj of %s. errno = %d",
555  dataObjInfo.objPath, errno );
556  unlink( dataObjInfo.filePath );
557  }
558  else {
559  ruleExecInfo_t rei;
560  dataObjInp_t dataObjInp;
561  bzero( &dataObjInp, sizeof( dataObjInp ) );
562  rstrcpy( dataObjInp.objPath, dataObjInfo.objPath, MAX_NAME_LEN );
563  initReiWithDataObjInp( &rei, rsComm, &dataObjInp );
564  rei.doi = &dataObjInfo;
565  rei.status = applyRule( "acPostProcForTarFileReg", NULL, &rei,
566  NO_SAVE_REI );
568  free(rei.condInputData);
569  if ( rei.status < 0 ) {
571  "regSubFile: acPostProcForTarFileReg error for %s. status = %d",
572  dataObjInfo.objPath );
573  }
574  }
575  return status;
576 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
getValByKey
char * getValByKey(const keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:675
DataObjInp::objPath
char objPath[(1024+64)]
Definition: dataObjInpOut.h:66
OpenedDataObjInp
Definition: dataObjInpOut.h:104
L1desc
l1desc_t L1desc[1026]
Definition: irods_server_globals.cpp:29
RESC_NAME_KW
#define RESC_NAME_KW
Definition: rodsKeyWdDef.h:19
NULL
#define NULL
Definition: rodsDef.h:70
BULK_OPR_KW
#define BULK_OPR_KW
Definition: rodsKeyWdDef.h:99
rsComm_t
Definition: rcConnect.h:145
getDefDirMode
int getDefDirMode()
Definition: physPath.cpp:1070
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
SYMLINKED_BUNFILE_NOT_ALLOWED
@ SYMLINKED_BUNFILE_NOT_ALLOWED
Definition: rodsErrorTable.h:280
DataObjInp::openFlags
int openFlags
Definition: dataObjInpOut.h:68
getFilePathName
int getFilePathName(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: physPath.cpp:87
DATA_MODIFY_KW
#define DATA_MODIFY_KW
Definition: rodsKeyWdDef.h:42
bulkRegUnbunSubfiles
int bulkRegUnbunSubfiles(rsComm_t *rsComm, const char *, const std::string &rescHier, char *collection, char *phyBunDir, int flags, genQueryOut_t *attriArray)
Definition: rsBulkDataObjPut.cpp:389
specColl.hpp
SYS_STRUCT_FILE_INMOUNTED_COLL
@ SYS_STRUCT_FILE_INMOUNTED_COLL
Definition: rodsErrorTable.h:143
rsDataObjOpen.hpp
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
objStat.h
irods_file_object.hpp
irods_stacktrace.hpp
RuleExecInfo::status
int status
Definition: irods_re_structs.hpp:19
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
resc_mgr
irods::resource_manager resc_mgr
Definition: irods_resource_manager.cpp:31
rsDataObjOpen
int rsDataObjOpen(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjOpen.cpp:45
OpenedDataObjInp::l1descInx
int l1descInx
Definition: dataObjInpOut.h:105
FORCE_FLAG_FLAG
#define FORCE_FLAG_FLAG
Definition: msParam.h:110
NO_SAVE_REI
#define NO_SAVE_REI
Definition: rodsDef.h:103
StructFileExtAndRegInp
Definition: structFileExtAndReg.h:7
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
REMOTE_OPEN
#define REMOTE_OPEN
Definition: getRemoteZoneResc.h:5
irods::experimental::administration::client::v1::exists
auto exists(rcComm_t &conn, const user &user) -> bool
Definition: user_administration.cpp:359
pid_age.p
p
Definition: pid_age.py:13
rsPhyBundleColl.hpp
svrRegDataObj
int svrRegDataObj(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
Definition: rsRegDataObj.cpp:120
l1desc::dataObjInfo
dataObjInfo_t * dataObjInfo
Definition: objDesc.hpp:42
DataObjInfo::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:132
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
renameFilePathToNewDir
int renameFilePathToNewDir(rsComm_t *rsComm, char *newDir, fileRenameInp_t *fileRenameInp, int renameFlag, char *)
Definition: physPath.cpp:652
regUnbunSubfiles
int regUnbunSubfiles(rsComm_t *rsComm, const dataObjInfo_t &_dataObjInfo, char *collection, char *phyBunDir, int flags, genQueryOut_t *attriArray)
Definition: rsStructFileExtAndReg.cpp:330
UNIX_FILE_LINK_ERR
@ UNIX_FILE_LINK_ERR
Definition: rodsErrorTable.h:320
RuleExecInfo::doi
dataObjInfo_t * doi
Definition: irods_re_structs.hpp:28
StructFileExtAndRegInp::objPath
char objPath[(1024+64)]
Definition: structFileExtAndReg.h:8
isSameZone
int isSameZone(char *zoneHint1, char *zoneHint2)
Definition: rodsConnect.cpp:891
irods_resource_backport.hpp
irods::resource_redirect
error resource_redirect(const std::string &, rsComm_t *, dataObjInp_t *, std::string &, rodsServerHost_t *&, int &, dataObjInfo_t **_data_obj_info=0)
Definition: irods_resource_redirect.cpp:786
rsUnbunAndRegPhyBunfile.hpp
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
chkCollForExtAndReg
int chkCollForExtAndReg(rsComm_t *rsComm, char *collection, rodsObjStat_t **rodsObjStatOut)
Definition: rsStructFileExtAndReg.cpp:262
fileRenameInp_t
Definition: fileRename.h:7
rcGlobalExtern.h
regSubfile
int regSubfile(rsComm_t *rsComm, const dataObjInfo_t &_dataObjInfo, char *subObjPath, char *subfilePath, const rodsLong_t dataSize, int flags)
Definition: rsStructFileExtAndReg.cpp:412
unbunPhyBunFile
int unbunPhyBunFile(rsComm_t *rsComm, char *objPath, const char *_resc_name, char *bunFilePath, char *phyBunDir, char *dataType, int saveLinkedFles, const char *resc_hier)
Definition: rsUnbunAndRegPhyBunfile.cpp:312
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
irods_resource_redirect.hpp
DATA_SIZE_KW
#define DATA_SIZE_KW
Definition: rodsKeyWdDef.h:24
checkCollAccessPerm
int checkCollAccessPerm(rsComm_t *rsComm, char *collection, char *accessPerm)
Definition: collection.cpp:35
StructFileExtAndRegInp::collection
char collection[(1024+64)]
Definition: structFileExtAndReg.h:9
CREATE_TYPE
#define CREATE_TYPE
Definition: dataObjInpOut.h:193
resolveLinkedPath
int resolveLinkedPath(rsComm_t *rsComm, char *objPath, specCollCache_t **specCollCache, keyValPair_t *condInput)
Definition: specColl.cpp:711
initReiWithDataObjInp
int initReiWithDataObjInp(ruleExecInfo_t *rei, rsComm_t *rsComm, dataObjInp_t *dataObjIn)
Definition: irods_re_structs.cpp:164
freeRodsObjStat
int freeRodsObjStat(rodsObjStat_t *rodsObjStat)
Definition: rcMisc.cpp:3537
RuleExecInfo::condInputData
keyValPair_t * condInputData
Definition: irods_re_structs.hpp:34
irods::OPEN_OPERATION
const std::string OPEN_OPERATION("OPEN")
rsComm_t::rError
rError_t rError
Definition: rcConnect.h:158
irods::error::code
long long code() const
Definition: irods_error.cpp:194
RESC_HIER_STR_KW
#define RESC_HIER_STR_KW
Definition: rodsKeyWdDef.h:225
rodsType.h
OPEN_TYPE_KW
#define OPEN_TYPE_KW
Definition: rodsKeyWdDef.h:95
rsDataObjClose
int rsDataObjClose(rsComm_t *rsComm, openedDataObjInp_t *dataObjCloseInp)
Definition: rsDataObjClose.cpp:56
UNIX_FILE_OPENDIR_ERR
@ UNIX_FILE_OPENDIR_ERR
Definition: rodsErrorTable.h:312
DataObjInp
Definition: dataObjInpOut.h:65
rsDataObjClose.hpp
NO_OPEN_FLAG_KW
#define NO_OPEN_FLAG_KW
Definition: rodsKeyWdDef.h:45
SYS_RESC_DOES_NOT_EXIST
@ SYS_RESC_DOES_NOT_EXIST
Definition: rodsErrorTable.h:145
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
fileModified
irods::error fileModified(rsComm_t *_comm, irods::first_class_object_ptr _object)
Definition: fileDriver.cpp:692
GenQueryOut
Definition: rodsGenQuery.h:67
addRErrorMsg
int addRErrorMsg(rError_t *myError, int status, const char *msg)
Definition: rcMisc.cpp:121
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
collection.hpp
StructFileExtAndRegInp::condInput
keyValPair_t condInput
Definition: structFileExtAndReg.h:12
physPath.hpp
irods::log
void log(const error &)
Definition: irods_log.cpp:13
modDataObjMeta_t::regParam
keyValPair_t * regParam
Definition: modDataObjMeta.h:9
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
modDataObjMeta_t::dataObjInfo
dataObjInfo_t * dataObjInfo
Definition: modDataObjMeta.h:8
SYS_PATH_IS_NOT_A_FILE
@ SYS_PATH_IS_NOT_A_FILE
Definition: rodsErrorTable.h:119
SpecColl::collection
char collection[(1024+64)]
Definition: objInfo.h:79
rodsGenQuery.h
collStatAllKinds
int collStatAllKinds(rsComm_t *rsComm, dataObjInp_t *dataObjInp, rodsObjStat_t **rodsObjStatOut)
Definition: collection.cpp:405
FORCE_FLAG_KW
#define FORCE_FLAG_KW
Definition: rodsKeyWdDef.h:13
irods::resource_manager::hier_to_leaf_id
error hier_to_leaf_id(const std::string &, rodsLong_t &)
Definition: irods_resource_manager.cpp:1082
irods::file_object
Definition: irods_file_object.hpp:19
fileOpr.hpp
rodsServerHost
Definition: rodsConnect.h:62
DataObjInfo::rescName
char rescName[64]
Definition: objInfo.h:131
apiHeaderAll.h
fileRenameInp_t::oldFileName
char oldFileName[(1024+64)]
Definition: fileRename.h:9
CAT_NO_ROWS_FOUND
@ CAT_NO_ROWS_FOUND
Definition: rodsErrorTable.h:423
rsMkCollR
int rsMkCollR(rsComm_t *rsComm, const char *startColl, const char *destColl)
Definition: collection.cpp:428
irods::file_object_ptr
boost::shared_ptr< file_object > file_object_ptr
Definition: irods_file_object.hpp:145
RuleExecInfo
Definition: irods_re_structs.hpp:18
rsModDataObjMeta
int rsModDataObjMeta(rsComm_t *rsComm, modDataObjMeta_t *modDataObjMetaInp)
Definition: rsModDataObjMeta.cpp:23
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
SYS_DIR_IN_VAULT_NOT_EMPTY
@ SYS_DIR_IN_VAULT_NOT_EMPTY
Definition: rodsErrorTable.h:149
MOUNTED_COLL
@ MOUNTED_COLL
Definition: objInfo.h:48
getAndConnRemoteZone
int getAndConnRemoteZone(rsComm_t *rsComm, dataObjInp_t *dataObjInp, rodsServerHost_t **rodsServerHost, char *remotZoneOpr)
Definition: rodsConnect.cpp:784
rsModDataObjMeta.hpp
applyRule
int applyRule(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: irods_re_structs.cpp:65
generate_iadmin_commands_for_41_to_42_upgrade.host
host
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:23
resource.hpp
ORPHAN_DIR
#define ORPHAN_DIR
Definition: physPath.hpp:21
createPhyBundleDir
int createPhyBundleDir(rsComm_t *rsComm, char *bunFilePath, char *outPhyBundleDir, char *hier)
Definition: rsPhyBundleColl.cpp:681
rcStructFileExtAndReg
int rcStructFileExtAndReg(rcComm_t *conn, structFileExtAndRegInp_t *structFileExtAndRegInp)
Definition: rcStructFileExtAndReg.cpp:23
ALL_REPL_STATUS_KW
#define ALL_REPL_STATUS_KW
Definition: rodsKeyWdDef.h:33
rodsObjStat
Definition: objStat.h:8
rsRegDataObj.hpp
rodsObjStat::specColl
specColl_t * specColl
Definition: objStat.h:18
rsStructFileExtAndReg
int rsStructFileExtAndReg(rsComm_t *rsComm, structFileExtAndRegInp_t *structFileExtAndRegInp)
Definition: rsStructFileExtAndReg.cpp:68
irods_random.hpp
UNIX_FILE_STAT_ERR
@ UNIX_FILE_STAT_ERR
Definition: rodsErrorTable.h:306
REPLICA_NOT_IN_RESC
@ REPLICA_NOT_IN_RESC
Definition: rodsErrorTable.h:770
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
dataObjOpr.hpp
DataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:74
modDataObjMeta_t
Definition: modDataObjMeta.h:7
ACCESS_DELETE_OBJECT
#define ACCESS_DELETE_OBJECT
Definition: icatDefines.h:60
SYS_COPY_ALREADY_IN_RESC
@ SYS_COPY_ALREADY_IN_RESC
Definition: rodsErrorTable.h:113
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
KeyValPair
Definition: objInfo.h:120
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047
mkDirForFilePath
int mkDirForFilePath(rsComm_t *rsComm, size_t startDirLen, const std::string &filePath, const std::string &hier, int mode)
Definition: fileOpr.cpp:120
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
DataObjInfo
Definition: objInfo.h:129
structFileExtAndReg.h
SYS_CROSS_ZONE_MV_NOT_SUPPORTED
@ SYS_CROSS_ZONE_MV_NOT_SUPPORTED
Definition: rodsErrorTable.h:174
irods::error::result
std::string result() const
Definition: irods_error.cpp:201
DataObjInfo::dataMode
char dataMode[32]
Definition: objInfo.h:148
replKeyVal
int replKeyVal(const keyValPair_t *srcCondInput, keyValPair_t *destCondInput)
Definition: rcMisc.cpp:739
SpecCollCache
Definition: objInfo.h:102
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
rsStructFileExtAndReg.hpp
objMetaOpr.hpp
SpecColl::collClass
specCollClass_t collClass
Definition: objInfo.h:77
chkOrphanFile
int chkOrphanFile(rsComm_t *rsComm, char *filePath, const char *rescName, dataObjInfo_t *dataObjInfo)
Definition: dataObjOpr.cpp:1099