76 :
TFile(url, strstr(
option,
"_WITHOUT_GLOBALREGISTRATION") != nullptr ?
"NET_WITHOUT_GLOBALREGISTRATION" :
"NET",
90 :
TFile(url,
"NET", ftitle, compress), fEndpointUrl(url)
173 sscanf(msg,
"%ld %ld %d %d %d %I64d %ld %d", &dev, &ino, &
mode,
174 &uid, &gid,
size, modtime, &islink);
176 sscanf(msg,
"%ld %ld %d %d %d %lld %ld %d", &dev, &ino, &
mode,
177 &uid, &gid,
size, modtime, &islink);
182 *
id = (dev << 24) + ino;
194 sscanf(msg,
"%ld %I64d %ld %ld",
id,
size, flags, modtime);
196 sscanf(msg,
"%ld %lld %ld %ld",
id,
size, flags, modtime);
259 Printf(
"Remote file: %s", &fname[1]);
288 Error(
"ReOpen",
"operation not supported by remote rootd (protocol = %d)",
322 Error(
"ReadBuffer",
"error sending kROOTD_GET command");
341 Error(
"ReadBuffer",
"error receiving buffer of length %d, got %d",
len,
n);
393 Int_t blockSize = 262144;
407 for(
Int_t i = 0; i < nbuf; i++) {
418 Error(
"ReadBuffers",
"error sending kROOTD_GETS command");
424 Error(
"ReadBuffers",
"error sending buffer");
437 while (actual_pos < total_len) {
438 Long64_t left = total_len - actual_pos;
439 if (left > blockSize)
448 Error(
"GetBuffers",
"error receiving buffer of length %d, got %d",
469 gPerfStats->FileReadEvent(
this, total_len, start);
477 Info(
"ReadBuffers",
"Couldnt use the specific implementation, calling TFile::ReadBuffers");
505 Error(
"WriteBuffer",
"error sending kROOTD_PUT command");
511 Error(
"WriteBuffer",
"error sending buffer");
577 Int_t sSize = netopt < -1 ? -netopt : 1;
589 Error(
"TNetFile",
"can't open %d-stream connection to rootd on "
592 Error(
"TNetFile",
"can't open connection to rootd on "
601 Warning(
"ConnectServer",
"rootd does not support \"+read\" option");
620 Recv(tmpstat, tmpkind);
661 Int_t tcpwindowsize = 65535;
679 if (!strcasecmp(
option,
"+read")) {
692 if (!create && !recreate && !
update) {
701 if (netopt > tcpwindowsize)
702 tcpwindowsize = netopt;
707 ConnectServer(&stat, &kind, netopt, tcpwindowsize, forceOpen, forceRead);
708 if (
gDebug > 2)
Info(
"Create",
"got from host %d %d", stat, kind);
799 :
TSystem(
"-root",
"Net file Helper System")
821 :
TSystem(
"-root",
"Net file Helper System")
917 "remote daemon does not support 'system' functionality");
997 Info(
"OpenDirectory",
"a directory is already open: close it first");
1024 if (dirp !=
fDirp) {
1025 Error(
"FreeDirectory",
"invalid directory pointer (should never happen)");
1048 if (dirp !=
fDirp) {
1049 Error(
"GetDirEntry",
"invalid directory pointer (should never happen)");
1115 if (!checkstd)
return kFALSE;
1119 if (path && strlen(path)) {
1137 Info(
"ConsistentWith",
"fUser:'%s' (%s), fHost:'%s' (%s), fPort:%d (%d)",
1145 return (checkstd && checknet);
1162 Warning(
"Unlink",
"functionality not implemented - ignored (path: %s)", path);
R__EXTERN const char * gRootdErrStr[]
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
R__EXTERN TApplication * gApplication
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char mode
TString ToLower(const TString &s)
Return a lower-case version of str.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Bool_t R_ISREG(Int_t mode)
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
TSignalHandler * GetSignalHandler() const
Bool_t fWritable
True if directory is writable.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Int_t MakeDirectory(const char *dir, Bool_t print=kFALSE) const
Make a remote directory.
void FreeDirectory(Bool_t print=kFALSE)
Free a remotely open directory via rootd.
Int_t GetPathInfo(const char *path, FileStat_t &buf, Bool_t print=kFALSE)
Get info about a file.
Bool_t OpenDirectory(const char *name, Bool_t print=kFALSE)
Open a directory via rootd.
TSocket * GetSocket() const
const char * GetDirEntry(Bool_t print=kFALSE)
Get directory entry via rootd.
Int_t Close()
Close ftp connection.
Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists, Bool_t print=kFALSE)
Returns kFALSE if one can access a file using the specified access mode.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static std::atomic< Long64_t > fgBytesRead
Number of bytes read by all TFile objects.
Int_t fReadCalls
Number of read calls ( not counting the cache calls )
static void SetFileBytesWritten(Long64_t bytes=0)
Long64_t fBytesRead
Number of bytes read from this file.
virtual Int_t ReOpen(Option_t *mode)
Reopen a file with a different access mode.
virtual Bool_t Matches(const char *name)
Return kTRUE if 'url' matches the coordinates of this file.
static Long64_t GetFileBytesWritten()
Static function returning the total number of bytes written to all files.
static void SetFileBytesRead(Long64_t bytes=0)
static void SetFileReadCalls(Int_t readcalls=0)
Int_t WriteBufferViaCache(const char *buf, Int_t len)
Write buffer via cache.
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Int_t ReadBufferViaCache(char *buf, Int_t len)
Read buffer via cache.
virtual Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
Read the nbuf blocks described in arrays pos and len.
Long64_t fArchiveOffset
!Offset at which file starts in archive
virtual void Init(Bool_t create)
Initialize a TFile object.
TString fOption
File options.
Bool_t FlushWriteCache()
Flush the write cache if active.
Long64_t fBytesWrite
Number of bytes written to this file.
virtual void SetOffset(Long64_t offset, ERelativeTo pos=kBeg)
Set position from where to start reading.
Long64_t fOffset
!Seek offset cache
static std::atomic< Long64_t > fgBytesWrite
Number of bytes written by all TFile objects.
void Close(Option_t *option="") override
Close a file.
static std::atomic< Int_t > fgReadCalls
Number of bytes read from all TFile objects.
static Int_t GetFileReadCalls()
Static function returning the total number of read calls from all files.
virtual void SetName(const char *name)
Set the name of the TNamed.
A TNetFile is like a normal TFile except that it reads and writes its data via a rootd server (for mo...
void Init(Bool_t create) override
Initialize a TNetFile object.
Bool_t ReadBuffer(char *buf, Int_t len) override
Read specified byte range from remote file via rootd daemon.
Bool_t WriteBuffer(const char *buf, Int_t len) override
Write specified byte range to remote file via rootd daemon.
Bool_t Matches(const char *url) override
Return kTRUE if 'url' matches the coordinates of this file.
virtual void Create(const char *url, Option_t *option, Int_t netopt)
Create a NetFile object.
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) override
Return file stat information.
Int_t SysClose(Int_t fd) override
Close currently open file.
virtual void ConnectServer(Int_t *stat, EMessageTypes *kind, Int_t netopt, Int_t tcpwindowsize, Bool_t forceOpen, Bool_t forceRead)
Connect to remote rootd server.
void Print(Option_t *option) const override
Print some info about the net file.
Bool_t IsOpen() const override
Retruns kTRUE if file is open, kFALSE otherwise.
Int_t Recv(Int_t &status, EMessageTypes &kind)
Return status from rootd server and message kind.
Int_t ReOpen(Option_t *mode) override
Reopen a file with a different access mode, like from READ to UPDATE or from NEW, CREATE,...
Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) override
Read a list of buffers given in pos[] and len[] and return it in a single buffer.
void Flush() override
Flush file to disk.
void PrintError(const char *where, Int_t err)
Print error string depending on error code.
void Seek(Long64_t offset, ERelativeTo pos=kBeg) override
Set position from where to start reading.
void Close(Option_t *option="") override
Close remote file.
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override
Open a remote file. Requires fOption to be set correctly.
virtual ~TNetFile()
TNetFile dtor. Send close message and close socket.
void Create(const char *url, TSocket *sock=nullptr)
Create a TNetSystem object.
Int_t MakeDirectory(const char *name) override
Make a directory via rootd.
TNetSystem(const TNetSystem &)=delete
void InitRemoteEntity(const char *url)
Parse and save coordinates of the remote entity (user, host, port, ...)
int Unlink(const char *path) override
Remove a path.
virtual ~TNetSystem()
Destructor.
Bool_t ConsistentWith(const char *path, void *dirptr) override
Check consistency of this helper with the one required by 'path' or 'dirptr'.
Int_t GetPathInfo(const char *path, FileStat_t &buf) override
Get info about a file.
const char * GetDirEntry(void *dirp=nullptr) override
Get directory entry via rootd. Returns 0 in case no more entries.
void FreeDirectory(void *dirp=nullptr) override
Free directory via rootd.
Bool_t AccessPathName(const char *path, EAccessMode mode) override
Returns FALSE if one can access a file using the specified access mode.
void * OpenDirectory(const char *name) override
Open a directory and return an opaque pointer to a dir structure.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
const char * GetHost() const
const char * GetUser() const
void HandleDelayedSignal()
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
Int_t GetRemoteProtocol() const
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
TSecContext * GetSecContext() const
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
static TSocket * CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size=0, Int_t tcpwindowsize=-1, TSocket *s=nullptr, Int_t *err=nullptr)
Creates a socket or a parallel socket and authenticates to the remote server specified in 'url' on re...
const char * GetUrl() const
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Bool_t IsAuthenticated() const
TString & Insert(Ssiz_t pos, const char *s)
const char * Data() const
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Abstract base class defining a generic interface to the underlying Operating System.
virtual void IgnoreInterrupt(Bool_t ignore=kTRUE)
If ignore is true ignore the interrupt signal, else restore previous behaviour.
static void ResetErrno()
Static function resetting system error number.
static Int_t GetErrno()
Static function returning system error number.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
virtual int MakeDirectory(const char *name)
Make a directory.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
virtual Bool_t ConsistentWith(const char *path, void *dirptr=nullptr)
Check consistency of this helper with the one required by 'path' or 'dirptr'.
The TTimeStamp encapsulates seconds and ns since EPOCH.
This class represents a WWW compatible URL.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
const char * GetFile() const
const char * GetUser() const
const char * GetHost() const
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
const char * GetOptions() const
const char * GetProtocol() const