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)  

rsSubStructFileRmdir.cpp
Go to the documentation of this file.
1 
3 #include "subStructFileRmdir.h"
4 #include "miscServerFunct.hpp"
5 #include "dataObjOpr.hpp"
7 
9 
10 
11 int
12 rsSubStructFileRmdir( rsComm_t *rsComm, subFile_t *subFile ) {
14  int remoteFlag;
15  int fd;
16 
17  remoteFlag = resolveHost( &subFile->addr, &rodsServerHost );
18 
19  if ( remoteFlag == LOCAL_HOST ) {
20  fd = _rsSubStructFileRmdir( rsComm, subFile );
21  }
22  else if ( remoteFlag == REMOTE_HOST ) {
23  fd = remoteSubStructFileRmdir( rsComm, subFile, rodsServerHost );
24  }
25  else {
26  if ( remoteFlag < 0 ) {
27  return remoteFlag;
28  }
29  else {
31  "rsSubStructFileRmdir: resolveHost returned unrecognized value %d",
32  remoteFlag );
34  }
35  }
36 
37  return fd;
38 }
39 
40 int
43  int fd;
44  int status;
45 
46  if ( rodsServerHost == NULL ) {
48  "remoteSubStructFileRmdir: Invalid rodsServerHost" );
50  }
51 
52  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
53  return status;
54  }
55 
56  fd = rcSubStructFileRmdir( rodsServerHost->conn, subFile );
57 
58  if ( fd < 0 ) {
60  "remoteSubStructFileRmdir: rcSubStructFileRmdir failed for %s, status = %d",
61  subFile->subFilePath, fd );
62  }
63 
64  return fd;
65 }
66 
68  subFile_t* _sub_file ) {
69  // =-=-=-=-=-=-=-
70  // create first class structured object
73  *_sub_file ) );
74  struct_obj->comm( _comm );
75  struct_obj->resc_hier( _sub_file->specColl->rescHier );
76 
77  // =-=-=-=-=-=-=-
78  // call abstrcated interface to rmdir
79  irods::error rmdir_err = fileRmdir( _comm, struct_obj );
80  if ( !rmdir_err.ok() ) {
81  std::stringstream msg;
82  msg << "failed on call to fileRmdir for [";
83  msg << struct_obj->physical_path();
84  msg << "]";
85  irods::log( PASSMSG( msg.str(), rmdir_err ) );
86  return rmdir_err.code();
87 
88  }
89  else {
90  return rmdir_err.code();
91 
92  }
93 
94 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
rsComm_t
Definition: rcConnect.h:145
rcSubStructFileRmdir
int rcSubStructFileRmdir(rcComm_t *conn, subFile_t *subFile)
Definition: rcSubStructFileRmdir.cpp:23
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
Subfile
Definition: objInfo.h:316
SYS_UNRECOGNIZED_REMOTE_FLAG
@ SYS_UNRECOGNIZED_REMOTE_FLAG
Definition: rodsErrorTable.h:88
rsSubStructFileRmdir
int rsSubStructFileRmdir(rsComm_t *rsComm, subFile_t *subFile)
Definition: rsSubStructFileRmdir.cpp:12
Subfile::subFilePath
char subFilePath[(1024+64)]
Definition: objInfo.h:318
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
Subfile::specColl
specColl_t * specColl
Definition: objInfo.h:322
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
rsSubStructFileRmdir.hpp
irods::error::code
long long code() const
Definition: irods_error.cpp:194
_rsSubStructFileRmdir
int _rsSubStructFileRmdir(rsComm_t *_comm, subFile_t *_sub_file)
Definition: rsSubStructFileRmdir.cpp:67
subStructFileRmdir.h
irods::structured_object
Definition: irods_structured_object.hpp:15
fileRmdir
irods::error fileRmdir(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:332
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
Subfile::addr
rodsHostAddr_t addr
Definition: objInfo.h:317
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
SpecColl::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:84
irods::log
void log(const error &)
Definition: irods_log.cpp:13
irods::structured_object_ptr
boost::shared_ptr< structured_object > structured_object_ptr
Definition: irods_structured_object.hpp:107
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
rodsServerHost
Definition: rodsConnect.h:62
irods_structured_object.hpp
dataObjOpr.hpp
remoteSubStructFileRmdir
int remoteSubStructFileRmdir(rsComm_t *rsComm, subFile_t *subFile, rodsServerHost_t *rodsServerHost)
Definition: rsSubStructFileRmdir.cpp:41
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
resolveHost
int resolveHost(rodsHostAddr_t *addr, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:375