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)  

fileOpr.hpp File Reference
#include "rodsConnect.h"
#include "fileDriver.hpp"
#include "chkNVPathPerm.h"
Include dependency graph for fileOpr.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fileDesc_t
 

Macros

#define NUM_FILE_DESC   1026 /* number of FileDesc */
 
#define FD_FREE   0
 
#define FD_INUSE   1
 
#define STREAM_FILE_NAME   "stream" /* a fake file name for stream */
 

Functions

int initFileDesc ()
 
int allocFileDesc ()
 
int allocAndFillFileDesc (rodsServerHost_t *rodsServerHost, const std::string &objPath, const std::string &fileName, const std::string &rescHier, int fd, int mode)
 
int freeFileDesc (int fileInx)
 
int getServerHostByFileInx (int fileInx, rodsServerHost_t **rodsServerHost)
 
int mkDirForFilePath (rsComm_t *rsComm, size_t startDirLen, const std::string &filePath, const std::string &hier, int mode)
 
int mkFileDirR (rsComm_t *rsComm, size_t startDirLen, const std::string &destDir, const std::string &hier, int mode)
 
int chkFilePathPerm (rsComm_t *rsComm, fileOpenInp_t *fileOpenInp, rodsServerHost_t *rodsServerHost, int chkType)
 
int isValidFilePath (const std::string &path)
 
int matchCliVaultPath (rsComm_t *, const std::string &, rodsServerHost_t *)
 
int chkEmptyDir (rsComm_t *rsComm, const std::string &cacheDir, const std::string &hier)
 
int filePathTypeInResc (rsComm_t *rsComm, const std::string &objPath, const std::string &fileName, const std::string &rescHier)
 
int bindStreamToIRods (rodsServerHost_t *rodsServerHost, int fd)
 

Macro Definition Documentation

◆ FD_FREE

#define FD_FREE   0

Definition at line 21 of file fileOpr.hpp.

◆ FD_INUSE

#define FD_INUSE   1

Definition at line 22 of file fileOpr.hpp.

◆ NUM_FILE_DESC

#define NUM_FILE_DESC   1026 /* number of FileDesc */

Definition at line 17 of file fileOpr.hpp.

◆ STREAM_FILE_NAME

#define STREAM_FILE_NAME   "stream" /* a fake file name for stream */

Definition at line 24 of file fileOpr.hpp.

Function Documentation

◆ allocAndFillFileDesc()

int allocAndFillFileDesc ( rodsServerHost_t rodsServerHost,
const std::string &  objPath,
const std::string &  fileName,
const std::string &  rescHier,
int  fd,
int  mode 
)

Definition at line 48 of file fileOpr.cpp.

References allocFileDesc(), fileDesc_t::fd, FileDesc, fileDesc_t::fileName, mode, fileDesc_t::mode, fileDesc_t::objPath, fileDesc_t::rescHier, and fileDesc_t::rodsServerHost.

Referenced by bindStreamToIRods(), rsFileCreate(), rsFileOpenByHost(), and rsFileOpendir().

Here is the call graph for this function:

◆ allocFileDesc()

int allocFileDesc ( )

Definition at line 31 of file fileOpr.cpp.

References FD_FREE, FD_INUSE, FileDesc, fileDesc_t::inuseFlag, LOG_NOTICE, NUM_FILE_DESC, rodsLog(), and SYS_OUT_OF_FILE_DESC.

Referenced by allocAndFillFileDesc().

Here is the call graph for this function:

◆ bindStreamToIRods()

int bindStreamToIRods ( rodsServerHost_t rodsServerHost,
int  fd 
)

Definition at line 576 of file fileOpr.cpp.

References allocAndFillFileDesc(), DEFAULT_FILE_MODE, and STREAM_FILE_NAME.

Referenced by _rsExecCmd(), and remoteExecCmd().

Here is the call graph for this function:

◆ chkEmptyDir()

int chkEmptyDir ( rsComm_t rsComm,
const std::string &  cacheDir,
const std::string &  hier 
)

Definition at line 263 of file fileOpr.cpp.

References irods::error::code(), rodsDirent::d_name, fileClosedir(), fileOpendir(), fileReaddir(), fileRmdir(), fileStat(), irods::log(), LOG_ERROR, MAX_NAME_LEN, irods::error::ok(), PASSMSG, rodsLog(), irods.pypyodbc::status, and SYS_DIR_IN_VAULT_NOT_EMPTY.

Referenced by procCacheDir().

Here is the call graph for this function:

◆ chkFilePathPerm()

int chkFilePathPerm ( rsComm_t rsComm,
fileOpenInp_t fileOpenInp,
rodsServerHost_t rodsServerHost,
int  chkType 
)

◆ filePathTypeInResc()

int filePathTypeInResc ( rsComm_t rsComm,
const std::string &  objPath,
const std::string &  fileName,
const std::string &  rescHier 
)

◆ freeFileDesc()

int freeFileDesc ( int  fileInx)

Definition at line 72 of file fileOpr.cpp.

References FileDesc, LOG_NOTICE, NULL, NUM_FILE_DESC, rodsLog(), and SYS_FILE_DESC_OUT_OF_RANGE.

Referenced by rsFileClose(), and rsFileClosedir().

Here is the call graph for this function:

◆ getServerHostByFileInx()

int getServerHostByFileInx ( int  fileInx,
rodsServerHost_t **  rodsServerHost 
)

Definition at line 99 of file fileOpr.cpp.

References FileDesc, rodsServerHost::localFlag, LOG_DEBUG, NUM_FILE_DESC, rodsLog(), fileDesc_t::rodsServerHost, and SYS_BAD_FILE_DESCRIPTOR.

Referenced by rsFileClose(), rsFileClosedir(), rsFileLseek(), rsFileRead(), rsFileReaddir(), and rsFileWrite().

Here is the call graph for this function:

◆ initFileDesc()

int initFileDesc ( )

Definition at line 25 of file fileOpr.cpp.

References FileDesc.

Referenced by initAgent().

◆ isValidFilePath()

int isValidFilePath ( const std::string &  path)

Definition at line 443 of file fileOpr.cpp.

References LOG_ERROR, rodsLog(), and SYS_INVALID_FILE_PATH.

Referenced by chkFilePathPerm(), and mkFileDirR().

Here is the call graph for this function:

◆ matchCliVaultPath()

int matchCliVaultPath ( rsComm_t ,
const std::string &  ,
rodsServerHost_t  
)

Definition at line 460 of file fileOpr.cpp.

References rsComm_t::clientUser, LOG_ERROR, LOG_NOTICE, irods::error::ok(), resc_mgr, rodsLog(), SYS_INVALID_INPUT_PARAM, userInfo_t::userName, and irods::resource_manager::validate_vault_path().

Referenced by chkFilePathPerm().

Here is the call graph for this function:

◆ mkDirForFilePath()

int mkDirForFilePath ( rsComm_t rsComm,
size_t  startDirLen,
const std::string &  filePath,
const std::string &  hier,
int  mode 
)

Definition at line 120 of file fileOpr.cpp.

References LOG_ERROR, LOG_NOTICE, MAX_NAME_LEN, mkFileDirR(), mode, rodsLog(), splitPathByKey(), and irods.pypyodbc::status.

Referenced by _rsFileCreate(), _rsFileStageToCache(), _rsFileSyncToArch(), _rsStructFileBundle(), bulkProcAndRegSubfile(), regPhySubFile(), and regSubfile().

Here is the call graph for this function:

◆ mkFileDirR()

int mkFileDirR ( rsComm_t rsComm,
size_t  startDirLen,
const std::string &  destDir,
const std::string &  hier,
int  mode 
)