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)  

filesystem.cpp
Go to the documentation of this file.
1 /* For copyright information please refer to files in the COPYRIGHT directory
2  */
3 
4 #include <sys/stat.h>
5 #include <errno.h>
6 #include "debug.hpp"
7 #include "utils.hpp"
8 #include "datetime.hpp"
9 #include "filesystem.hpp"
11 #include "irods_log.hpp"
12 #include "rodsConnect.h"
13 
14 char *getRuleBasePath(const char *ruleBaseName, char rulesFileName[MAX_NAME_LEN] ) {
15  std::string cfg_file, fn( ruleBaseName );
16  fn += ".re";
18  if ( !ret.ok() ) {
19  irods::log( PASS( ret ) );
20  return nullptr;
21  }
22  return rstrcpy( rulesFileName, cfg_file.c_str(), MAX_NAME_LEN);
23 }
24 
25 int getModifiedTime( const char *fn, time_type *timestamp ) {
26  boost::filesystem::path path( fn );
27  try {
29  time_type_set( *timestamp, time );
30  return 0;
31  } catch ( const boost::filesystem::filesystem_error& _e ) {
32  rodsLog(LOG_ERROR, "getModifiedTime: last_write_time call failed on [%s] with msg: [%s]", fn, _e.what());
33  return -1;
34  }
35 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
irods::get_full_path_for_config_file
error get_full_path_for_config_file(const std::string &, std::string &)
Definition: irods_get_full_path_for_config_file.cpp:20
time_type_set
#define time_type_set(mtim, timestamp)
Definition: datetime.hpp:18
utils.hpp
irods_get_full_path_for_config_file.hpp
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
irods::experimental::filesystem::client::last_write_time
auto last_write_time(rcComm_t &_comm, const path &_p) -> object_time_type
Definition: filesystem.cpp:645
filesystem.hpp
getRuleBasePath
char * getRuleBasePath(const char *ruleBaseName, char rulesFileName[(1024+64)])
Definition: filesystem.cpp:14
datetime.hpp
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
rodsConnect.h
getModifiedTime
int getModifiedTime(const char *fn, time_type *timestamp)
Definition: filesystem.cpp:25
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
irods::log
void log(const error &)
Definition: irods_log.cpp:13
debug.hpp
irods::error
Definition: irods_error.hpp:23
time_type
time_t time_type
Definition: datetime.hpp:15
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods_log.hpp