CERN org.glite.Gfal
2.0.1
|
00001 #pragma once 00002 #ifndef _GFAL2_POSIX_API_ 00003 #define _GFAL2_POSIX_API_ 00004 /* 00005 * Copyright (c) Members of the EGEE Collaboration. 2004. 00006 * See http://www.eu-egee.org/partners/ for details on the copyright holders. 00007 * 00008 * Licensed under the Apache License, Version 2.0 (the "License"); 00009 * you may not use this file except in compliance with the License. 00010 * You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, software 00015 * distributed under the License is distributed on an "AS IS" BASIS, 00016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 * See the License for the specific language governing permissions and 00018 * limitations under the License. 00019 */ 00029 #include <sys/types.h> 00030 #include <fcntl.h> 00031 #include <dirent.h> 00032 #include <sys/stat.h> 00033 #include <stdlib.h> 00034 #include <stdio.h> 00035 #include <unistd.h> 00036 #include <attr/xattr.h> 00037 00038 #include <common/gfal_constants.h> 00039 00040 #ifdef __cplusplus 00041 extern "C" 00042 { 00043 #endif 00044 00045 00046 00047 00048 00049 00060 int gfal_chmod(const char* path, mode_t mode); 00061 int gfal_rename (const char *oldpath, const char * newpath); 00062 00063 // access and stat purpose 00064 int gfal_stat (const char *, struct stat *); 00065 int gfal_lstat (const char *, struct stat *); 00066 int gfal_access (const char *, int); 00067 ssize_t gfal_readlink(const char* path, char* buff, size_t buffsiz); 00068 int gfal_symlink(const char* oldpath, const char * newpath); 00069 00070 00071 //classical read/write operations 00072 int gfal_creat (const char *, mode_t); 00073 int gfal_open(const char * path, int flag, ...); 00074 off_t gfal_lseek (int, off_t, int); 00075 int gfal_close (int); 00076 int gfal_read (int, void *, size_t); 00077 int gfal_write (int, const void *, size_t); 00078 00079 // pipelined calls, for vector read/write 00080 ssize_t gfal_pread(int fd, void * buffer, size_t count, off_t offset); 00081 ssize_t gfal_pwrite(int fd, const void * buffer, size_t count, off_t offset); 00082 00083 // advanced use purpose ( set properties, guid, replicas ) 00084 ssize_t gfal_getxattr (const char *path, const char *name, 00085 void *value, size_t size); 00086 ssize_t gfal_listxattr (const char *path, char *list, size_t size); 00087 00088 int gfal_setxattr (const char *path, const char *name, 00089 const void *value, size_t size, int flags); 00090 00091 int gfal_removexattr(const char *path, const char *name); 00092 00093 00094 00095 00096 00097 // directory management purpose 00098 int gfal_mkdir (const char *, mode_t); 00099 DIR *gfal_opendir (const char *); 00100 int gfal_closedir (DIR *); 00101 struct dirent *gfal_readdir (DIR *); 00102 00103 00104 int gfal_rmdir (const char *); 00105 int gfal_unlink (const char *); 00106 00107 00108 // error management 00109 int gfal_posix_check_error(); 00110 void gfal_posix_clear_error(); 00111 void gfal_posix_release_error(); 00112 char* gfal_posix_strerror_r(char* buff_err, size_t s_err); 00113 void gfal_posix_print_error(); 00114 int gfal_posix_code_error(); 00115 00116 00117 // define the verbose mode 00118 int gfal_set_verbose (int); 00119 char *gfal_version(); 00120 00121 // sync 00122 int gfal_flush(int fd); 00123 00124 00125 00126 int gfal_set_parameter_string(const char* namespc, const char* key, const char* value); 00127 char* gfal_get_parameter_string(const char* namespc, const char* key); 00128 00129 int gfal_set_parameter_string_list(const char* namespc, const char* key, const char* value[], size_t len); 00130 char** gfal_get_parameter_string_list(const char* namespc, const char* key, size_t* s_buff); 00131 00132 int gfal_set_parameter_int(const char* namespc, const char* key, int value); 00133 int gfal_get_parameter_int(const char* namespc, const char* key); 00134 00135 00136 int gfal_get_parameter_boolean(const char* namespc, const char* key); 00137 int gfal_set_parameter_boolean(const char* namespc, const char* key, int bool_value); 00138 00139 00144 #ifdef __cplusplus 00145 } 00146 #endif 00147 00148 00149 #endif // _GFAL2_POSIX_API_