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)  

rodsPath.cpp
Go to the documentation of this file.
1 
3 /* rodsPath - a number of string operations designed for secure string
4  * copying.
5  */
6 
7 #include "rodsPath.h"
8 #include "miscUtil.h"
9 #include "rcMisc.h"
10 #include "rodsErrorTable.h"
11 #include "rodsLog.h"
12 #ifdef windows_platform
13 #include "irodsntutil.hpp"
14 #endif
15 
16 #include "filesystem/path.hpp"
17 
18 #include <string>
19 #include <map>
20 
21 #include <boost/filesystem/operations.hpp>
22 #include <boost/filesystem/convenience.hpp>
23 
24 /* parseRodsPathStr - This is similar to parseRodsPath except the
25  * input and output are char string inPath and outPath
26  */
27 
28 int
29 parseRodsPathStr( const char *inPath, rodsEnv *myRodsEnv, char *outPath ) {
30  int status;
31  rodsPath_t rodsPath;
32 
33  rstrcpy( rodsPath.inPath, inPath, MAX_NAME_LEN );
34 
35  status = parseRodsPath( &rodsPath, myRodsEnv );
36 
37  if ( status < 0 ) {
38  return status;
39  }
40 
41  rstrcpy( outPath, rodsPath.outPath, MAX_NAME_LEN );
42 
43  return status;
44 }
45 
46 /* parseRodsPath - Parse a rods path into full rods path taking care of
47  * all the "/../", "/./" and "." entries in the path.
48  * The input is taken from rodsPath->inPath.
49  * The output path is written in rodsPath->outPath.
50  *
51  */
52 
53 int
54 parseRodsPath( rodsPath_t *rodsPath, rodsEnv *myRodsEnv ) {
55  int len;
56  char *tmpPtr1, *tmpPtr2;
57  char tmpStr[MAX_NAME_LEN];
58 
59 
60  if ( rodsPath == NULL ) {
61  fprintf( stderr, "parseRodsPath: NULL rodsPath input\n" );
62  return USER__NULL_INPUT_ERR;
63  }
64 
65  rodsPath->objType = UNKNOWN_OBJ_T;
66  rodsPath->objState = UNKNOWN_ST;
67 
68  if ( myRodsEnv == NULL && rodsPath->inPath[0] != '/' ) {
69  fprintf( stderr, "parseRodsPath: NULL myRodsEnv input\n" );
70  return USER__NULL_INPUT_ERR;
71  }
72 
73  len = strlen( rodsPath->inPath );
74 
75  if ( len == 0 ) {
76  /* just copy rodsCwd */
77  rstrcpy( rodsPath->outPath, myRodsEnv->rodsCwd, MAX_NAME_LEN );
78  rodsPath->objType = COLL_OBJ_T;
79  return 0;
80  }
81  else if ( strcmp( rodsPath->inPath, "." ) == 0 ||
82  strcmp( rodsPath->inPath, "./" ) == 0 ) {
83  /* '.' or './' */
84  rstrcpy( rodsPath->outPath, myRodsEnv->rodsCwd, MAX_NAME_LEN );
85  rodsPath->objType = COLL_OBJ_T;
86  return 0;
87  }
88  else if ( strcmp( rodsPath->inPath, "~" ) == 0 ||
89  strcmp( rodsPath->inPath, "~/" ) == 0) {
90  /* ~ or ~/ */
91  rstrcpy( rodsPath->outPath, myRodsEnv->rodsHome, MAX_NAME_LEN );
92  rodsPath->objType = COLL_OBJ_T;
93  return 0;
94  }
95  else if (rodsPath->inPath[0] == '~') {
96  if ( rodsPath->inPath[1] == '/' ) {
97  snprintf( rodsPath->outPath, MAX_NAME_LEN, "%s/%s",
98  myRodsEnv->rodsHome, rodsPath->inPath + 2 );
99  }
100  else {
101  // treat it like a relative path
102  snprintf( rodsPath->outPath, MAX_NAME_LEN, "%s/%s",
103  myRodsEnv->rodsCwd, rodsPath->inPath );
104  }
105  }
106  else if ( rodsPath->inPath[0] == '/' ) {
107  /* full path */
108  rstrcpy( rodsPath->outPath, rodsPath->inPath, MAX_NAME_LEN );
109  }
110  else {
111  /* a relative path */
112  snprintf( rodsPath->outPath, MAX_NAME_LEN, "%s/%s",
113  myRodsEnv->rodsCwd, rodsPath->inPath );
114  }
115 
116  /* take out any "//" */
117 
118  while ( ( tmpPtr1 = strstr( rodsPath->outPath, "//" ) ) != NULL ) {
119  // rstrcpy (tmpPtr1 + 1, tmpPtr1 + 2, MAX_NAME_LEN);
120  rstrcpy( tmpStr, tmpPtr1 + 2, MAX_NAME_LEN );
121  rstrcpy( tmpPtr1 + 1, tmpStr, MAX_NAME_LEN );
122  }
123 
124  /* take out any "/./" */
125 
126  while ( ( tmpPtr1 = strstr( rodsPath->outPath, "/./" ) ) != NULL ) {
127  // rstrcpy (tmpPtr1 + 1, tmpPtr1 + 3, MAX_NAME_LEN);
128  rstrcpy( tmpStr, tmpPtr1 + 3, MAX_NAME_LEN );
129  rstrcpy( tmpPtr1 + 1, tmpStr, MAX_NAME_LEN );
130  }
131 
132  /* take out any /../ */
133 
134  while ( ( tmpPtr1 = strstr( rodsPath->outPath, "/../" ) ) != NULL ) {
135  /* go back */
136  tmpPtr2 = tmpPtr1 - 1;
137  while ( *tmpPtr2 != '/' ) {
138  tmpPtr2 --;
139  if ( tmpPtr2 < rodsPath->outPath ) {
141  "parseRodsPath: parsing error for %s",
142  rodsPath->outPath );
143  return USER_INPUT_PATH_ERR;
144  }
145  }
146  // rstrcpy (tmpPtr2 + 1, tmpPtr1 + 4, MAX_NAME_LEN);
147  rstrcpy( tmpStr, tmpPtr1 + 4, MAX_NAME_LEN );
148  rstrcpy( tmpPtr2 + 1, tmpStr, MAX_NAME_LEN );
149  }
150 
151  /* handle "/.", "/.." and "/" at the end */
152 
153  len = strlen( rodsPath->outPath );
154 
155  tmpPtr1 = rodsPath->outPath + len;
156 
157  if ( ( tmpPtr2 = strstr( tmpPtr1 - 3, "/.." ) ) != NULL ) {
158  /* go back */
159  tmpPtr2 -= 1;
160  while ( *tmpPtr2 != '/' ) {
161  tmpPtr2 --;
162  if ( tmpPtr2 < rodsPath->outPath ) {
164  "parseRodsPath: parsing error for %s",
165  rodsPath->outPath );
166  return USER_INPUT_PATH_ERR;
167  }
168  }
169  *tmpPtr2 = '\0';
170  if ( tmpPtr2 == rodsPath->outPath ) { /* nothing, special case */
171  *tmpPtr2++ = '/'; /* root */
172  *tmpPtr2 = '\0';
173  }
174  rodsPath->objType = COLL_OBJ_T;
175  if ( strlen( rodsPath->outPath ) >= MAX_PATH_ALLOWED - 1 ) {
176  return USER_PATH_EXCEEDS_MAX;
177  }
178  return 0;
179  }
180 
181  /* take out "/." */
182 
183  if ( ( tmpPtr2 = strstr( tmpPtr1 - 2, "/." ) ) != NULL ) {
184  *tmpPtr2 = '\0';
185  rodsPath->objType = COLL_OBJ_T;
186  if ( strlen( rodsPath->outPath ) >= MAX_PATH_ALLOWED - 1 ) {
187  return USER_PATH_EXCEEDS_MAX;
188  }
189  return 0;
190  }
191 
192  if ( *( tmpPtr1 - 1 ) == '/' && len > 1 ) {
193  *( tmpPtr1 - 1 ) = '\0';
194  rodsPath->objType = COLL_OBJ_T;
195  if ( strlen( rodsPath->outPath ) >= MAX_PATH_ALLOWED - 1 ) {
196  return USER_PATH_EXCEEDS_MAX;
197  }
198  return 0;
199  }
200  if ( strlen( rodsPath->outPath ) >= MAX_PATH_ALLOWED - 1 ) {
201  return USER_PATH_EXCEEDS_MAX;
202  }
203  return 0;
204 }
205 
206 /* parseLocalPath - Parse a local path into full path taking care of
207  * all the "/../", "/./" and "." entries in the path.
208  * The input is taken from rodsPath->inPath.
209  * The output path is written in rodsPath->outPath.
210  * In addition, a stat is done on the rodsPath->outPath to determine the
211  * objType and size of the file.
212  */
213 
214 int
216  if ( rodsPath == NULL ) {
217  fprintf( stderr, "parseLocalPath: NULL rodsPath input\n" );
218  return USER__NULL_INPUT_ERR;
219  }
220 
221  if ( strlen( rodsPath->inPath ) == 0 ) {
222  rstrcpy( rodsPath->outPath, ".", MAX_NAME_LEN );
223  }
224  else {
225  rstrcpy( rodsPath->outPath, rodsPath->inPath, MAX_NAME_LEN );
226  }
227 
228  return getFileType( rodsPath );
229 }
230 
231 int
232 getFileType( rodsPath_t *rodsPath ) {
233  boost::filesystem::path p( rodsPath->outPath );
234 
235  try {
236  if ( !exists( p ) ) {
237  rodsPath->objType = UNKNOWN_FILE_T;
238  rodsPath->objState = NOT_EXIST_ST;
239  return NOT_EXIST_ST;
240  }
241  else if ( is_regular_file( p ) ) {
242  rodsPath->objType = LOCAL_FILE_T;
243  rodsPath->objState = EXIST_ST;
244  rodsPath->size = file_size( p );
245  }
246  else if ( is_directory( p ) ) {
247  rodsPath->objType = LOCAL_DIR_T;
248  rodsPath->objState = EXIST_ST;
249  }
250  }
251  catch ( const boost::filesystem::filesystem_error& e ) {
252  fprintf( stderr, "%s\n", e.what() );
253  return SYS_NO_PATH_PERMISSION;
254  }
255 
256 
257  return rodsPath->objType;
258 }
259 
260 int
261 addSrcInPath( rodsPathInp_t *rodsPathInp, const char *inPath ) {
262  rodsPath_t *newSrcPath, *newTargPath;
263  int newNumSrc;
264 
265  if ( rodsPathInp == NULL || inPath == NULL ) {
267  "addSrcInPath: NULL input" );
268  return USER__NULL_INPUT_ERR;
269  }
270 
271  // Issue #3658 - This section removes trailing slashes from the
272  // incoming directory path in an invoking icommand (e.g. ireg).
273  //
274  // TODO: This is a localized fix that addresses any trailing slashes
275  // in inPath. Any future refactoring of the code that deals with paths
276  // would most probably take care of this issue, and the code segment
277  // below would/should then be removed.
278 
279  char tmpStr[MAX_NAME_LEN];
280 
281  rstrcpy( tmpStr, inPath, MAX_NAME_LEN );
282  size_t len = strlen(tmpStr);
283  for (size_t i = len-1; i > 0 && tmpStr[i] == '/'; i--) {
284  tmpStr[i] = '\0';
285  }
286  const char *modInPath = const_cast<const char *>(tmpStr); // end of 3658 fix
287 
288  if ( ( rodsPathInp->numSrc % PTR_ARRAY_MALLOC_LEN ) == 0 ) {
289  newNumSrc = rodsPathInp->numSrc + PTR_ARRAY_MALLOC_LEN;
290  newSrcPath = ( rodsPath_t * ) malloc( newNumSrc * sizeof( rodsPath_t ) );
291  newTargPath = ( rodsPath_t * ) malloc( newNumSrc * sizeof( rodsPath_t ) );
292  memset( ( void * ) newSrcPath, 0, newNumSrc * sizeof( rodsPath_t ) );
293  memset( ( void * ) newTargPath, 0, newNumSrc * sizeof( rodsPath_t ) );
294  if ( rodsPathInp->numSrc > 0 ) {
295  memcpy( newSrcPath, rodsPathInp->srcPath,
296  rodsPathInp->numSrc * sizeof( rodsPath_t ) );
297  memcpy( newTargPath, rodsPathInp->targPath,
298  rodsPathInp->numSrc * sizeof( rodsPath_t ) );
299  free( rodsPathInp->srcPath );
300  free( rodsPathInp->targPath );
301  }
302  rodsPathInp->srcPath = newSrcPath;
303  rodsPathInp->targPath = newTargPath;
304  }
305  else {
306  newSrcPath = rodsPathInp->srcPath;
307  }
308  rstrcpy( newSrcPath[rodsPathInp->numSrc].inPath, modInPath, MAX_NAME_LEN );
309  rodsPathInp->numSrc++;
310 
311  return 0;
312 }
313 
314 /* parseCmdLinePath - parse the iCommand line path input. It can parse
315  * path input of the form:
316  * 1) srcPath1, srcPath2 ... destPath
317  * 2) srcPath1, srcPath2 ...
318  *
319  * The source and destination paths can be irodsPath (data object) or
320  * local path.
321  * srcFileType/destFileType = UNKNOWN_OBJ_T means the path is a irodsPath.
322  * srcFileType/destFileType = UNKNOWN_FILE_T means the path is a local path
323  * destFileType = NULL_T means there is no destPath.
324  *
325  * argc and argv should be the usual values directly from the main ()
326  * routine.
327  * optind - directly from the getopt call if the path inputs are directly
328  * behind the input options or equal to (optind + n) where
329  * where n is number of arguments before the path inputs.
330  *
331  * rodsPathInp - The output struct.
332  * typedef struct RodsPathInp {
333  * int numSrc;
334  * rodsPath_t *srcPath; // pointer to an array of rodsPath_t
335  * rodsPath_t *destPath;
336  * } rodsPathInp_t;
337  *
338  * typedef struct RodsPath {
339  * objType_t objType;
340  * rodsLong_t size;
341  * char inPath[MAX_NAME_LEN];
342  * char outPath[MAX_NAME_LEN];
343  * } rodsPath_t;
344  *
345  * inPath contains the input value.
346  * outPath contains the parsed output path.
347  *
348  * Note that parseCmdLinePath only parses the path. It does not resolve the
349  * dependency of the destination path to the source path.
350  * e.g., "iput foo1 ."
351  * The resolveRodsTarget() should be called to resolve the dependency.
352  *
353  */
354 
355 int
356 parseCmdLinePath( int argc, char **argv, int optInd, rodsEnv *myRodsEnv,
357  int srcFileType, int destFileType, int flag, rodsPathInp_t *rodsPathInp ) {
358  int nInput;
359  int i, status;
360  int numSrc;
361 
362  nInput = argc - optInd;
363 
364  if ( rodsPathInp == NULL ) {
365  rodsLog( LOG_ERROR, "parseCmdLinePath: NULL rodsPathInp input" );
366  return USER__NULL_INPUT_ERR;
367  }
368 
369  memset( rodsPathInp, 0, sizeof( rodsPathInp_t ) );
370 
371  if ( nInput <= 0 ) {
372  if ( ( flag & ALLOW_NO_SRC_FLAG ) == 0 ) {
373  return USER__NULL_INPUT_ERR;
374  }
375  else {
376  numSrc = 1;
377  }
378  }
379  else if ( nInput == 1 ) {
380  numSrc = 1;
381  }
382  else if ( destFileType == NO_INPUT_T ) { /* no dest input */
383  numSrc = nInput;
384  }
385  else {
386  numSrc = nInput - 1;
387  }
388 
389  for ( i = 0; i < numSrc; i++ ) {
390  if ( nInput <= 0 ) {
391  /* just add cwd */
392  addSrcInPath( rodsPathInp, "." );
393  }
394  else {
395  addSrcInPath( rodsPathInp, argv[optInd + i] );
396  }
397 
398  if ( srcFileType <= COLL_OBJ_T ) {
399  status = parseRodsPath( &rodsPathInp->srcPath[i], myRodsEnv );
400  if (status == 0) {
401  auto* escaped_path = escape_path(rodsPathInp->srcPath->outPath);
402  rstrcpy(rodsPathInp->srcPath->outPath, escaped_path, MAX_NAME_LEN);
403  std::free(escaped_path);
404  }
405  }
406  else {
407  status = parseLocalPath( &rodsPathInp->srcPath[i] );
408  }
409 
410  if ( status < 0 ) {
411  return status;
412  }
413  }
414 
415  if ( destFileType != NO_INPUT_T ) {
416  rodsPathInp->destPath = ( rodsPath_t* )malloc( sizeof( rodsPath_t ) );
417  memset( rodsPathInp->destPath, 0, sizeof( rodsPath_t ) );
418  if ( nInput > 1 ) {
419  rstrcpy( rodsPathInp->destPath->inPath, argv[argc - 1],
420  MAX_NAME_LEN );
421  }
422  else {
423  rstrcpy( rodsPathInp->destPath->inPath, ".", MAX_NAME_LEN );
424  }
425 
426  if ( destFileType <= COLL_OBJ_T ) {
427  status = parseRodsPath( rodsPathInp->destPath, myRodsEnv );
428  if (status == 0) {
429  auto* escaped_path = escape_path(rodsPathInp->destPath->outPath);
430  rstrcpy(rodsPathInp->destPath->outPath, escaped_path, MAX_NAME_LEN);
431  std::free(escaped_path);
432  }
433  }
434  else {
435  status = parseLocalPath( rodsPathInp->destPath );
436  }
437  }
438 
439  return status;
440 }
441 
442 
443 int
444 getLastPathElement(char* _logical_path, char* _last_path_element)
445 {
446  if (!_logical_path) {
447  *_last_path_element = '\0';
448  return 0;
449  }
450 
451  namespace fs = irods::experimental::filesystem;
452 
453  std::string path_string = _logical_path;
454 
455  if (fs::path::preferred_separator == path_string.back()) {
456  path_string = path_string.substr(0, path_string.size() - 1);
457  rstrcpy(_last_path_element, path_string.data(), MAX_NAME_LEN);
458  return 0;
459  }
460 
461  auto object_name = fs::path{_logical_path}.object_name();
462 
463  if ("." == object_name || ".." == object_name) {
464  object_name.remove_object_name();
465  *_last_path_element = '\0';
466  return 0;
467  }
468 
469  path_string = object_name.string();
470 
471  if (fs::path::preferred_separator == path_string.back()) {
472  path_string = path_string.substr(0, path_string.size() - 1);
473  }
474 
475  rstrcpy(_last_path_element, path_string.data(), MAX_NAME_LEN);
476 
477  return 0;
478 }
479 
480 void
481 clearRodsPath( rodsPath_t *rodsPath ) {
482  if ( rodsPath == NULL ) {
483  return;
484  }
485 
486  if ( rodsPath->rodsObjStat == NULL ) {
487  return;
488  }
489 
490  freeRodsObjStat( rodsPath->rodsObjStat );
491 
492  memset( rodsPath, 0, sizeof( rodsPath_t ) );
493 
494  return;
495 }
496 
497 char* escape_path(const char* _path)
498 {
499  static const std::map<char, std::string> special_char_mappings{
500  {'\f', "\\f"}
501  };
502 
503  std::string path = _path;
504  std::string escaped_path;
505  const auto end = std::end(special_char_mappings);
506 
507  for (auto&& c : path) {
508  const auto iter = special_char_mappings.find(c);
509 
510  if (end != iter) {
511  escaped_path += iter->second;
512  }
513  else {
514  escaped_path += c;
515  }
516  }
517 
518  const auto size = escaped_path.size() + 1;
519  char* escaped_path_c_str = static_cast<char*>(std::malloc(sizeof(char) * size));
520  std::memset(escaped_path_c_str, '\0', size);
521  std::strcpy(escaped_path_c_str, escaped_path.c_str());
522 
523  return escaped_path_c_str;
524 }
525 
526 int has_trailing_path_separator(const char* path)
527 {
528  if (std::string_view p = path; !p.empty()) {
529  namespace fs = irods::experimental::filesystem;
530  return *std::rbegin(p) == fs::path::preferred_separator;
531  }
532 
533  return 0;
534 }
535 
537 {
538  if (!path) {
539  return;
540  }
541 
542  namespace fs = irods::experimental::filesystem;
543 
544  const fs::path p = path;
545 
546  // If the last path element is not empty, then the path does not
547  // end with trailing slashes.
548  if (!std::rbegin(p)->empty()) {
549  return;
550  }
551 
552  fs::path new_p;
553 
554  for (auto iter = std::begin(p), end = std::prev(std::end(p)); iter != end; ++iter) {
555  new_p /= *iter;
556  }
557 
558  std::strcpy(path, new_p.c_str());
559 }
560 
561 int has_prefix(const char* path, const char* prefix)
562 {
563  namespace fs = irods::experimental::filesystem;
564 
565  const fs::path parent = prefix;
566  const fs::path child = path;
567 
568  if (parent == child) {
569  return false;
570  }
571 
572  auto p_iter = std::begin(parent);
573  auto p_last = std::end(parent);
574  auto c_iter = std::begin(child);
575  auto c_last = std::end(child);
576 
577  for (; p_iter != p_last && c_iter != c_last && *p_iter == *c_iter; ++p_iter, ++c_iter);
578 
579  return (p_iter == p_last);
580 }
581 
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
ALLOW_NO_SRC_FLAG
#define ALLOW_NO_SRC_FLAG
Definition: rodsPath.h:44
RodsPath::rodsObjStat
rodsObjStat_t * rodsObjStat
Definition: rodsPath.h:27
irods.pyparsing.empty
empty
Definition: pyparsing.py:3430
rodsPath.h
UNKNOWN_ST
@ UNKNOWN_ST
Definition: rodsType.h:47
escape_path
char * escape_path(const char *_path)
Definition: rodsPath.cpp:497
UNKNOWN_OBJ_T
@ UNKNOWN_OBJ_T
Definition: rodsType.h:37
parseCmdLinePath
int parseCmdLinePath(int argc, char **argv, int optInd, rodsEnv *myRodsEnv, int srcFileType, int destFileType, int flag, rodsPathInp_t *rodsPathInp)
Definition: rodsPath.cpp:356
UNKNOWN_FILE_T
@ UNKNOWN_FILE_T
Definition: rodsType.h:40
RodsPathInp
Definition: rodsPath.h:33
has_trailing_path_separator
int has_trailing_path_separator(const char *path)
Definition: rodsPath.cpp:526
irods::experimental::administration::client::v1::exists
auto exists(rcComm_t &conn, const user &user) -> bool
Definition: user_administration.cpp:359
rcMisc.h
pid_age.p
p
Definition: pid_age.py:13
parseRodsPath
int parseRodsPath(rodsPath_t *rodsPath, rodsEnv *myRodsEnv)
Definition: rodsPath.cpp:54
RodsPath::inPath
char inPath[(1024+64)]
Definition: rodsPath.h:23
RodsPath::objState
objStat_t objState
Definition: rodsPath.h:20
NO_INPUT_T
@ NO_INPUT_T
Definition: rodsType.h:43
RodsPathInp::srcPath
rodsPath_t * srcPath
Definition: rodsPath.h:35
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
SYS_NO_PATH_PERMISSION
@ SYS_NO_PATH_PERMISSION
Definition: rodsErrorTable.h:103
RodsPath::objType
objType_t objType
Definition: rodsPath.h:19
irods::experimental::filesystem::client::end
auto end(const collection_iterator &) noexcept -> const collection_iterator
Definition: collection_iterator.hpp:88
freeRodsObjStat
int freeRodsObjStat(rodsObjStat_t *rodsObjStat)
Definition: rcMisc.cpp:3537
getFileType
int getFileType(rodsPath_t *rodsPath)
Definition: rodsPath.cpp:232
COLL_OBJ_T
@ COLL_OBJ_T
Definition: rodsType.h:39
RodsPathInp::targPath
rodsPath_t * targPath
Definition: rodsPath.h:37
getLastPathElement
int getLastPathElement(char *_logical_path, char *_last_path_element)
Definition: rodsPath.cpp:444
irods::experimental::filesystem::client::begin
auto begin(collection_iterator _iter) noexcept -> collection_iterator
Definition: collection_iterator.hpp:83
RodsPathInp::destPath
rodsPath_t * destPath
Definition: rodsPath.h:36
parseLocalPath
int parseLocalPath(rodsPath_t *rodsPath)
Definition: rodsPath.cpp:215
MAX_PATH_ALLOWED
#define MAX_PATH_ALLOWED
Definition: rodsDef.h:58
irods::experimental::filesystem
Definition: collection_entry.hpp:12
clearRodsPath
void clearRodsPath(rodsPath_t *rodsPath)
Definition: rodsPath.cpp:481
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
RodsPath::size
rodsLong_t size
Definition: rodsPath.h:21
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
rodsLog.h
parseRodsPathStr
int parseRodsPathStr(const char *inPath, rodsEnv *myRodsEnv, char *outPath)
Definition: rodsPath.cpp:29
RodsPath::outPath
char outPath[(1024+64)]
Definition: rodsPath.h:24
remove_trailing_path_separators
void remove_trailing_path_separators(char *path)
Definition: rodsPath.cpp:536
LOCAL_DIR_T
@ LOCAL_DIR_T
Definition: rodsType.h:42
RodsPathInp::numSrc
int numSrc
Definition: rodsPath.h:34
PTR_ARRAY_MALLOC_LEN
#define PTR_ARRAY_MALLOC_LEN
Definition: rodsDef.h:73
has_prefix
int has_prefix(const char *path, const char *prefix)
Definition: rodsPath.cpp:561
USER_PATH_EXCEEDS_MAX
@ USER_PATH_EXCEEDS_MAX
Definition: rodsErrorTable.h:267
rodsEnv::rodsCwd
char rodsCwd[(1024+64)]
Definition: getRodsEnv.h:15
EXIST_ST
@ EXIST_ST
Definition: rodsType.h:49
rodsErrorTable.h
size
long long size
Definition: filesystem.cpp:102
RodsPath
Definition: rodsPath.h:18
miscUtil.h
rodsEnv::rodsHome
char rodsHome[(1024+64)]
Definition: getRodsEnv.h:14
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
LOCAL_FILE_T
@ LOCAL_FILE_T
Definition: rodsType.h:41
path.hpp
rodsEnv
Definition: getRodsEnv.h:8
NOT_EXIST_ST
@ NOT_EXIST_ST
Definition: rodsType.h:48
USER_INPUT_PATH_ERR
@ USER_INPUT_PATH_ERR
Definition: rodsErrorTable.h:248
USER__NULL_INPUT_ERR
@ USER__NULL_INPUT_ERR
Definition: rodsErrorTable.h:247
addSrcInPath
int addSrcInPath(rodsPathInp_t *rodsPathInp, const char *inPath)
Definition: rodsPath.cpp:261