From f0bd0788d201ea01ae7d7d9ea1bc50ff72ee20f0 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Mon, 26 Feb 2024 18:25:41 +0100 Subject: [PATCH] Remove code related to the `gfal` option The `gfal` option was deprecated in ROOT 6.28 and removed in 6.30 (see 3be3aadf). This commit suggests to remove remaining code related to the `gfal` option. --- .../root-ci-config/buildconfig/global.txt | 1 - .../root-ci-config/buildconfig/windows10.txt | 1 - cmake/modules/FindGFAL.cmake | 42 -- cmake/modules/RootConfiguration.cmake | 5 - cmake/modules/SearchInstalledSoftware.cmake | 16 - config/Makefile.in | 4 - config/rootrc.in | 2 +- documentation/doxygen/makeinput.sh | 1 - documentation/users-guide/InstallandBuild.md | 2 +- etc/plugins/TFile/P050_TGFALFile.C | 5 - io/CMakeLists.txt | 3 - io/gfal/CMakeLists.txt | 19 - io/gfal/inc/LinkDef.h | 20 - io/gfal/inc/TGFALFile.h | 70 --- io/gfal/src/TGFALFile.cxx | 468 ------------------ 15 files changed, 2 insertions(+), 657 deletions(-) delete mode 100644 cmake/modules/FindGFAL.cmake delete mode 100644 etc/plugins/TFile/P050_TGFALFile.C delete mode 100644 io/gfal/CMakeLists.txt delete mode 100644 io/gfal/inc/LinkDef.h delete mode 100644 io/gfal/inc/TGFALFile.h delete mode 100644 io/gfal/src/TGFALFile.cxx diff --git a/.github/workflows/root-ci-config/buildconfig/global.txt b/.github/workflows/root-ci-config/buildconfig/global.txt index 741ff882cc810..c56650c07b392 100644 --- a/.github/workflows/root-ci-config/buildconfig/global.txt +++ b/.github/workflows/root-ci-config/buildconfig/global.txt @@ -54,7 +54,6 @@ fftw3=ON fitsio=ON fortran=OFF gdml=ON -gfal=OFF gminimal=OFF gnuinstall=OFF gsl_shared=OFF diff --git a/.github/workflows/root-ci-config/buildconfig/windows10.txt b/.github/workflows/root-ci-config/buildconfig/windows10.txt index ed14ecf0eb627..1b1337e49664c 100644 --- a/.github/workflows/root-ci-config/buildconfig/windows10.txt +++ b/.github/workflows/root-ci-config/buildconfig/windows10.txt @@ -18,7 +18,6 @@ builtin_zstd=ON cudnn=OFF davix=OFF fftw3=OFF -gfal=OFF llvm13_broken_tests=OFF minuit2_mpi=OFF minuit2_omp=OFF diff --git a/cmake/modules/FindGFAL.cmake b/cmake/modules/FindGFAL.cmake deleted file mode 100644 index 74028ac5a7f35..0000000000000 --- a/cmake/modules/FindGFAL.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. -# All rights reserved. -# -# For the licensing terms see $ROOTSYS/LICENSE. -# For the list of contributors see $ROOTSYS/README/CREDITS. - -# - Locate GFAL library -# Defines: -# -# GFAL_FOUND -# GFAL_INCLUDE_DIR -# GFAL_INCLUDE_DIRS (not cached) -# GFAL_LIBRARIES (not cached) - -find_path(GFAL_INCLUDE_DIR NAMES gfal_api.h - PATH_SUFFIXES . gfal gfal2 - HINTS ${GFAL_DIR}/include $ENV{GFAL_DIR}/include) -find_library(GFAL_LIBRARY NAMES gfal gfal2 - HINTS ${GFAL_DIR}/lib $ENV{GFAL_DIR}/lib) - -set(GFAL_LIBRARIES ${GFAL_LIBRARY}) -set(GFAL_INCLUDE_DIRS ${GFAL_INCLUDE_DIR}) - -if(GFAL_LIBRARY MATCHES gfal2) - # use pkg-config to get the directories for glib and then use these values - find_package(PkgConfig) - pkg_check_modules(GLIB2 REQUIRED glib-2.0) - list(APPEND GFAL_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS}) - set(GFAL_DEP GLIB2_INCLUDE_DIRS) -else() - find_path(SRM_IFCE_INCLUDE_DIR gfal_srm_ifce_types.h - HINTS ${SRM_IFCE_DIR}/include $ENV{SRM_IFCE_DIR}/include) - list(APPEND GFAL_INCLUDE_DIRS ${SRM_IFCE_INCLUDE_DIR}) - set(GFAL_DEP SRM_IFCE_INCLUDE_DIR) -endif() - -# handle the QUIETLY and REQUIRED arguments and set GFAL_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GFAL DEFAULT_MSG GFAL_INCLUDE_DIR ${GFAL_DEP} GFAL_LIBRARY) - -mark_as_advanced(GFAL_FOUND GFAL_INCLUDE_DIR GFAL_LIBRARY SRM_IFCE_INCLUDE_DIR GLIB2_INCLUDE_DIRS) diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index 4705c5e96c5fd..51b53a5c15b8c 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -215,11 +215,6 @@ set(glewlibdir ${GLEW_LIBRARY_DIR}) set(glewlibs ${GLEW_LIBRARIES}) set(glewincdir ${GLEW_INCLUDE_DIR}) -set(buildgfal ${value${gfal}}) -set(gfallibdir ${GFAL_LIBRARY_DIR}) -set(gfallib ${GFAL_LIBRARY}) -set(gfalincdir ${GFAL_INCLUDE_DIR}) - set(buildarrow ${value${arrow}}) set(arrowlibdir ${ARROW_LIBRARY_DIR}) set(arrowlib ${ARROW_LIBRARY}) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index b4176829ec3d1..c881bec91b3be 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -1021,22 +1021,6 @@ if(arrow) endif() -#---Check for gfal------------------------------------------------------------------- -if(gfal) - find_package(GFAL) - if(NOT GFAL_FOUND) - if(fail-on-missing) - message(FATAL_ERROR "Gfal library not found and is required (gfal option enabled)") - else() - message(STATUS "GFAL library not found. Set variable GFAL_DIR to point to your gfal installation - and the variable SRM_IFCE_DIR to the srm_ifce installation") - message(STATUS "For the time being switching OFF 'gfal' option") - set(gfal OFF CACHE BOOL "Disabled because GFAL not found (${gfal_description})" FORCE) - endif() - endif() -endif() - - #---Check for dCache------------------------------------------------------------------- if(dcache) find_package(DCAP) diff --git a/config/Makefile.in b/config/Makefile.in index c1fb8d4af7e86..61ce58f9942be 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -196,10 +196,6 @@ ifeq ($(BUILDGLEW), yes) GLEWCPPFLAGS := -DBUILTIN_GLEW endif -BUILDGFAL := @buildgfal@ -GFALLIBDIR := @gfallibdir@ -GFALCLILIB := @gfallib@ -GFALINCDIR := $(filter-out /usr/include, @gfalincdir@) SRMIFCEINCDIR := $(filter-out /usr/include, @srmifceincdir@) GLIB2INCDIR := $(filter-out /usr/include, @glib2incdir@) diff --git a/config/rootrc.in b/config/rootrc.in index a4099acb1e63a..9e13249b719ac 100644 --- a/config/rootrc.in +++ b/config/rootrc.in @@ -489,7 +489,7 @@ TS3WebFile.Root.MultiRangeServer: Huawei OBS # In case the file namespace descriptor ends with - the namespace # is not a part of the filename. # Extend in private .rootrc with a +Url.Special line. -Url.Special: file: hpss: gfal: dcache: +Url.Special: file: hpss: dcache: +Url.Special: /alien/- # PROOF XRD client variables diff --git a/documentation/doxygen/makeinput.sh b/documentation/doxygen/makeinput.sh index 120e096904e03..ed2519accd21a 100755 --- a/documentation/doxygen/makeinput.sh +++ b/documentation/doxygen/makeinput.sh @@ -48,7 +48,6 @@ echo " ../../hist/ \\" >> Doxyfile_INPUT echo " ../../html/ \\" >> Doxyfile_INPUT echo " ../../io/doc/TFile \\" >> Doxyfile_INPUT echo " ../../io/dcache/ \\" >> Doxyfile_INPUT -echo " ../../io/gfal/ \\" >> Doxyfile_INPUT echo " ../../io/io/ \\" >> Doxyfile_INPUT echo " ../../io/sql/ \\" >> Doxyfile_INPUT echo " ../../io/xml/ \\" >> Doxyfile_INPUT diff --git a/documentation/users-guide/InstallandBuild.md b/documentation/users-guide/InstallandBuild.md index 5793e9209c645..03ec02b0042f8 100644 --- a/documentation/users-guide/InstallandBuild.md +++ b/documentation/users-guide/InstallandBuild.md @@ -650,7 +650,7 @@ namespace descriptor ends with - the namespace is not a part of the filename. Extend in private .rootrc with a +Url.Special line. ``` {.cpp} -Url.Special: file: rfio: hpss: castor: gfal: dcache: +Url.Special: file: rfio: hpss: castor: dcache: +Url.Special: /alien/- /castor/ ``` diff --git a/etc/plugins/TFile/P050_TGFALFile.C b/etc/plugins/TFile/P050_TGFALFile.C deleted file mode 100644 index 796a752589578..0000000000000 --- a/etc/plugins/TFile/P050_TGFALFile.C +++ /dev/null @@ -1,5 +0,0 @@ -void P050_TGFALFile() -{ - gPluginMgr->AddHandler("TFile", "^gfal:", "TGFALFile", - "GFAL", "TGFALFile(const char*,Option_t*,const char*,Int_t)"); -} diff --git a/io/CMakeLists.txt b/io/CMakeLists.txt index 34814ab66e619..c7ac7c28bef9c 100644 --- a/io/CMakeLists.txt +++ b/io/CMakeLists.txt @@ -11,9 +11,6 @@ add_subdirectory(xml) if(xml) add_subdirectory(xmlparser) endif() -if(gfal) - add_subdirectory(gfal) -endif() if(dcache) add_subdirectory(dcache) endif() diff --git a/io/gfal/CMakeLists.txt b/io/gfal/CMakeLists.txt deleted file mode 100644 index b60e7f8ae29a7..0000000000000 --- a/io/gfal/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. -# All rights reserved. -# -# For the licensing terms see $ROOTSYS/LICENSE. -# For the list of contributors see $ROOTSYS/README/CREDITS. - -############################################################################ -# CMakeLists.txt file for building ROOT io/gfal package -############################################################################ - -add_definitions(-D_FILE_OFFSET_BITS=64) - -ROOT_STANDARD_LIBRARY_PACKAGE(GFAL - HEADERS TGFALFile.h - SOURCES src/TGFALFile.cxx - LIBRARIES ${GFAL_LIBRARIES} - DEPENDENCIES Core Net RIO) - -target_include_directories(GFAL PRIVATE ${GFAL_INCLUDE_DIRS}) diff --git a/io/gfal/inc/LinkDef.h b/io/gfal/inc/LinkDef.h deleted file mode 100644 index 8feee18ece41d..0000000000000 --- a/io/gfal/inc/LinkDef.h +++ /dev/null @@ -1,20 +0,0 @@ -/* @(#)root/gfal:$Id$ */ - -/************************************************************************* - * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. * - * All rights reserved. * - * * - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifdef __CINT__ - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; - -#pragma link C++ class TGFALFile; -#pragma link C++ class TGFALSystem; - -#endif diff --git a/io/gfal/inc/TGFALFile.h b/io/gfal/inc/TGFALFile.h deleted file mode 100644 index 818763f358c78..0000000000000 --- a/io/gfal/inc/TGFALFile.h +++ /dev/null @@ -1,70 +0,0 @@ -// @(#)root/gfal:$Id$ -// Author: Fons Rademakers 8/12/2005 - -/************************************************************************* - * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. * - * All rights reserved. * - * * - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOT_TGFALFile -#define ROOT_TGFALFile - -#include "TFile.h" -#include "TSystem.h" - - -class TGFALFile : public TFile { - -private: - Bool_t fStatCached; /// -#include "TROOT.h" -#include "TUrl.h" - -#include - -// GFAL2 doesn't use special names for 64 bit versions -#if defined(_GFAL2_API_) || defined(GFAL2_API_) || defined(_GFAL2_API) || defined(_GFAL2_API_H_) || defined(GFAL2_API_H_) || defined(_GFAL2_API_H) -#define gfal_lseek64 gfal_lseek -#define gfal_open64 gfal_open -#define gfal_readdir64 gfal_readdir -#define gfal_stat64 gfal_stat -#define dirent64 dirent -#define stat64 stat -#endif - -#include "TGFALFile.h" - -ClassImp(TGFALFile); -ClassImp(TGFALSystem); - -//////////////////////////////////////////////////////////////////////////////// -/// Create a GFAL file object. -/// -/// A GFAL file is the same as a TFile -/// except that it is being accessed via the underlaying Grid access -/// mechanism. The url argument must be of the form: gfal:/lfn/file.root -/// If the file specified in the URL does not exist, is not accessable -/// or can not be created the kZombie bit will be set in the TGFALFile -/// object. Use IsZombie() to see if the file is accessable. -/// For a description of the option and other arguments see the TFile ctor. -/// The preferred interface to this constructor is via TFile::Open(). - -TGFALFile::TGFALFile(const char *url, Option_t *option, const char *ftitle, - Int_t compress) - : TFile(url, "NET", ftitle, compress) -{ - fStatCached = kFALSE; - - fOption = option; - fOption.ToUpper(); - - if (fOption == "NEW") - fOption = "CREATE"; - - Bool_t create = (fOption == "CREATE") ? kTRUE : kFALSE; - Bool_t recreate = (fOption == "RECREATE") ? kTRUE : kFALSE; - Bool_t update = (fOption == "UPDATE") ? kTRUE : kFALSE; - Bool_t read = (fOption == "READ") ? kTRUE : kFALSE; - if (!create && !recreate && !update && !read) { - read = kTRUE; - fOption = "READ"; - } - - TString stmp; - char *fname; - if ((fname = gSystem->ExpandPathName(fUrl.GetFileAndOptions()))) { - stmp = fname; - delete [] fname; - fname = (char *)stmp.Data(); - } else { - Error("TGFALFile", "error expanding path %s", fUrl.GetFileAndOptions()); - goto zombie; - } - - if (recreate) { - if (::gfal_access(fname, kFileExists) == 0) - ::gfal_unlink(fname); - recreate = kFALSE; - create = kTRUE; - fOption = "CREATE"; - } - if (create && ::gfal_access(fname, kFileExists) == 0) { - Error("TGFALFile", "file %s already exists", fname); - goto zombie; - } - if (update) { - if (::gfal_access(fname, kFileExists) != 0) { - update = kFALSE; - create = kTRUE; - } - if (update && ::gfal_access(fname, kWritePermission) != 0) { - Error("TGFALFile", "no write permission, could not open file %s", fname); - goto zombie; - } - } - if (read) { -#ifdef GFAL_ACCESS_FIXED - if (::gfal_access(fname, kFileExists) != 0) { - Error("TGFALFile", "file %s does not exist", fname); - goto zombie; - } - if (::gfal_access(fname, kReadPermission) != 0) { - Error("TGFALFile", "no read permission, could not open file %s", fname); - goto zombie; - } -#endif - } - - // Connect to file system stream - fRealName = fname; - - if (create || update) { -#ifndef WIN32 - fD = SysOpen(fname, O_RDWR | O_CREAT, 0644); -#else - fD = SysOpen(fname, O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE); -#endif - if (fD == -1) { - SysError("TGFALFile", "file %s can not be opened", fname); - goto zombie; - } - fWritable = kTRUE; - } else { -#ifndef WIN32 - fD = SysOpen(fname, O_RDONLY, 0644); -#else - fD = SysOpen(fname, O_RDONLY | O_BINARY, S_IREAD | S_IWRITE); -#endif - if (fD == -1) { - SysError("TGFALFile", "file %s can not be opened for reading", fname); - goto zombie; - } - fWritable = kFALSE; - } - - Init(create); - - return; - -zombie: - // error in file opening occured, make this object a zombie - MakeZombie(); - gDirectory = gROOT; -} - -//////////////////////////////////////////////////////////////////////////////// -/// GFAL file dtor. Close and flush directory structure. - -TGFALFile::~TGFALFile() -{ - Close(); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Interface to system open. All arguments like in POSIX open. - -Int_t TGFALFile::SysOpen(const char *pathname, Int_t flags, UInt_t mode) -{ - Int_t ret = ::gfal_open64(pathname, flags, (Int_t) mode); - - return ret; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Interface to system close. All arguments like in POSIX close. - -Int_t TGFALFile::SysClose(Int_t fd) -{ - Int_t ret = ::gfal_close(fd); - - return ret; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Interface to system read. All arguments like in POSIX read. - -Int_t TGFALFile::SysRead(Int_t fd, void *buf, Int_t len) -{ - Int_t ret = ::gfal_read(fd, buf, len); - - return ret; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Interface to system write. All arguments like in POSIX write. - -Int_t TGFALFile::SysWrite(Int_t fd, const void *buf, Int_t len) -{ - Int_t ret = ::gfal_write(fd, buf, len); - - return ret; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Interface to system lseek. All arguments like in POSIX lseek -/// except that the offset and return value are Long_t to be able to -/// handle 64 bit file systems. - -Long64_t TGFALFile::SysSeek(Int_t fd, Long64_t offset, Int_t whence) -{ - Long64_t ret = ::gfal_lseek64(fd, offset, whence); - - return ret; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Interface to TSystem:GetPathInfo(). Generally implemented via -/// stat() or fstat(). - -Int_t TGFALFile::SysStat(Int_t /*fd*/, Long_t *id, Long64_t *size, Long_t *flags, - Long_t *modtime) -{ - struct stat64 &statbuf = fStatBuffer; - - if (fOption != "READ" || !fStatCached) { - // We are not in read mode, or the file status information is not yet - // in the cache. Update or read the status information with gfal_stat(). - - if (::gfal_stat64(fRealName, &statbuf) >= 0) - fStatCached = kTRUE; - } - - if (fStatCached) { - if (id) - *id = (statbuf.st_dev << 24) + statbuf.st_ino; - if (size) - *size = statbuf.st_size; - if (modtime) - *modtime = statbuf.st_mtime; - if (flags) { - *flags = 0; - if (statbuf.st_mode & ((S_IEXEC)|(S_IEXEC>>3)|(S_IEXEC>>6))) - *flags |= 1; - if ((statbuf.st_mode & S_IFMT) == S_IFDIR) - *flags |= 2; - if ((statbuf.st_mode & S_IFMT) != S_IFREG && - (statbuf.st_mode & S_IFMT) != S_IFDIR) - *flags |= 4; - } - return 0; - } - - return 1; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Read specified byte range from remote file via GFAL. -/// Returns kTRUE in case of error. - -Bool_t TGFALFile::ReadBuffer(char *buf, Int_t len) -{ - Int_t st; - if ((st = ReadBufferViaCache(buf, len))) { - if (st == 2) - return kTRUE; - return kFALSE; - } - - return TFile::ReadBuffer(buf, len); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Read specified byte range from remote file via GFAL. -/// Returns kTRUE in case of error. - -Bool_t TGFALFile::ReadBuffer(char *buf, Long64_t pos, Int_t len) -{ - SetOffset(pos); - Int_t st; - if ((st = ReadBufferViaCache(buf, len))) { - if (st == 2) - return kTRUE; - return kFALSE; - } - - return TFile::ReadBuffer(buf, pos, len); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Write specified byte range to remote file via GFAL. -/// Returns kTRUE in case of error. - -Bool_t TGFALFile::WriteBuffer(const char *buf, Int_t len) -{ - if (!IsOpen() || !fWritable) return kTRUE; - - Int_t st; - if ((st = WriteBufferViaCache(buf, len))) { - if (st == 2) - return kTRUE; - return kFALSE; - } - - return TFile::WriteBuffer(buf, len); -} - -/** -\class TGFALSystem -\ingroup IO - -Directory handler for GFAL. -*/ - -//////////////////////////////////////////////////////////////////////////////// -/// Create helper class that allows directory access via GFAL. - -TGFALSystem::TGFALSystem() : TSystem("-gfal", "GFAL Helper System") -{ - // name must start with '-' to bypass the TSystem singleton check - SetName("gfal"); - - fDirp = 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Make a directory via GFAL. - -Int_t TGFALSystem::MakeDirectory(const char *dir) -{ - TUrl url(dir); - - Int_t ret = ::gfal_mkdir(url.GetFileAndOptions(), 0755); - - return ret; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Open a directory via GFAL. Returns an opaque pointer to a dir -/// structure. Returns 0 in case of error. - -void *TGFALSystem::OpenDirectory(const char *dir) -{ - if (fDirp) { - Error("OpenDirectory", "invalid directory pointer (should never happen)"); - fDirp = 0; - } - - TUrl url(dir); - - struct stat64 finfo; - - if (::gfal_stat64(url.GetFileAndOptions(), &finfo) < 0) - return 0; - - if ((finfo.st_mode & S_IFMT) != S_IFDIR) - return 0; - - fDirp = (void*) ::gfal_opendir(url.GetFileAndOptions()); - - return fDirp; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Free directory via GFAL. - -void TGFALSystem::FreeDirectory(void *dirp) -{ - if (dirp != fDirp) { - Error("FreeDirectory", "invalid directory pointer (should never happen)"); - return; - } - - if (dirp) - ::gfal_closedir((DIR*)dirp); - - fDirp = 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get directory entry via GFAL. Returns 0 in case no more entries. - -const char *TGFALSystem::GetDirEntry(void *dirp) -{ - if (dirp != fDirp) { - Error("GetDirEntry", "invalid directory pointer (should never happen)"); - return 0; - } - - struct dirent64 *dp; - - if (dirp) { - dp = ::gfal_readdir64((DIR*)dirp); - if (!dp) - return 0; - return dp->d_name; - } - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get info about a file. Info is returned in the form of a FileStat_t -/// structure (see TSystem.h). -/// The function returns 0 in case of success and 1 if the file could -/// not be stat'ed. - -Int_t TGFALSystem::GetPathInfo(const char *path, FileStat_t &buf) -{ - TUrl url(path); - - struct stat64 sbuf; - - if (path && ::gfal_stat64(url.GetFileAndOptions(), &sbuf) >= 0) { - - buf.fDev = sbuf.st_dev; - buf.fIno = sbuf.st_ino; - buf.fMode = sbuf.st_mode; - buf.fUid = sbuf.st_uid; - buf.fGid = sbuf.st_gid; - buf.fSize = sbuf.st_size; - buf.fMtime = sbuf.st_mtime; - buf.fIsLink = kFALSE; - - return 0; - } - return 1; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Returns FALSE if one can access a file using the specified access mode. -/// Mode is the same as for the Unix access(2) function. -/// Attention, bizarre convention of return value!! - -Bool_t TGFALSystem::AccessPathName(const char *path, EAccessMode mode) -{ - TUrl url(path); - - if (::gfal_access(url.GetFileAndOptions(), mode) == 0) - return kFALSE; - - return kTRUE; -}