Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TNetFile.cxx
Go to the documentation of this file.
1// @(#)root/net:$Id$
2// Author: Fons Rademakers 14/08/97
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/**
13\file TNetFile.cxx
14\class TNetFile
15\ingroup IO
16
17A TNetFile is like a normal TFile except that it reads and writes
18its data via a rootd server (for more on the rootd daemon see the
19source files in `root/rootd/src/`). TNetFile file names are in
20standard URL format with protocol "root" or "roots". The following
21are valid TNetFile URL's:
22- `root://hpbrun.cern.ch/root/hsimple.root`
23- `root://pcna49a:5151/~na49/data/run821.root`
24- `root://pcna49d.cern.ch:5050//v1/data/run810.root`
25
26The only difference with the well known httpd URL's is that the root
27of the remote file tree is the user's home directory. Therefore an
28absolute pathname requires a // after the host or port specifier
29(see last example). Further the expansion of the standard shell
30characters, like ~, $, .., are handled as expected.
31TNetFile (actually TUrl) uses 1094 as default port for rootd.
32
33Connecting to a rootd requires the remote user id and password.
34TNetFile allows three ways for you to provide your login:
35 Setting it globally via the static functions:
361. TAuthenticate::SetGlobalUser() and TAuthenticate::SetGlobalPasswd()
372. Getting it from the `~/.netrc` file (same file as used by ftp)
383. Command line prompt
39The different methods will be tried in the order given above.
40On machines with AFS rootd will authenticate using AFS (if it was
41compiled with AFS support).
42
43If the protocol is specified as "rootk" kerberos5 will be used for
44authentication.
45
46The rootd daemon lives in the directory `$ROOTSYS/bin`. It can be
47started either via inetd or by hand from the command line (no need
48to be super user).
49**/
50
51#include <cerrno>
52
53#include "Bytes.h"
54#include "NetErrors.h"
55#include "TApplication.h"
56#include "TEnv.h"
57#include "TNetFile.h"
58#include "TPSocket.h"
59#include "TROOT.h"
60#include "TSysEvtHandler.h"
61#include "TSystem.h"
62#include "TTimeStamp.h"
63#include "TVirtualPerfStats.h"
64
65// fgClientProtocol is now in TAuthenticate
66
67
68////////////////////////////////////////////////////////////////////////////////
69/// Create a TNetFile object. This is actually done inside Create(), so
70/// for a description of the options and other arguments see Create().
71/// Normally a TNetFile is created via TFile::Open().
72
74 : TFile(url, strstr(option, "_WITHOUT_GLOBALREGISTRATION") != nullptr ? "NET_WITHOUT_GLOBALREGISTRATION" : "NET",
76 fEndpointUrl(url)
77{
78 fSocket = 0;
80}
81
82////////////////////////////////////////////////////////////////////////////////
83/// Create a TNetFile object. To be used by derived classes, that need
84/// to initialize the TFile base class but not open a connection at this
85/// moment.
86
87TNetFile::TNetFile(const char *url, const char *ftitle, Int_t compress, Bool_t)
88 : TFile(url, "NET", ftitle, compress), fEndpointUrl(url)
89{
90 fSocket = 0;
91 fProtocol = 0;
92 fErrorCode = 0;
93 fNetopt = 0;
94}
95
96////////////////////////////////////////////////////////////////////////////////
97/// TNetFile dtor. Send close message and close socket.
98
100{
101 Close();
102}
103
104////////////////////////////////////////////////////////////////////////////////
105/// Open a remote file. Requires fOption to be set correctly.
106
107Int_t TNetFile::SysOpen(const char * /*file*/, Int_t /*flags*/, UInt_t /*mode*/)
108{
109 if (!fSocket) {
110
112 if (!fSocket) return -1;
113
114 } else {
115
116 if (fProtocol > 15) {
117 fSocket->Send(Form("%s %s", fUrl.GetFile(), ToLower(fOption).Data()),
119 } else {
120 // Old daemon versions expect an additional slash at beginning
121 fSocket->Send(Form("/%s %s", fUrl.GetFile(), ToLower(fOption).Data()),
123 }
124
125 EMessageTypes kind;
126 int stat;
127 Recv(stat, kind);
128
129 if (kind == kROOTD_ERR) {
130 PrintError("SysOpen", stat);
131 return -1;
132 }
133 }
134
135 // This means ok for net files
136 return -2; // set as fD in ReOpen
137}
138
139////////////////////////////////////////////////////////////////////////////////
140/// Close currently open file.
141
143{
144 if (fSocket)
146
147 return 0;
148}
149
150////////////////////////////////////////////////////////////////////////////////
151/// Return file stat information. The interface and return value is
152/// identical to TSystem::GetPathInfo().
153
155{
156 if (fProtocol < 3) return 1;
157
158 if (!fSocket) return 1;
159
161
162 char msg[1024];
163 Int_t kind;
164 fSocket->Recv(msg, sizeof(msg), kind);
165
166 Int_t mode, uid, gid, islink;
167 Long_t dev, ino;
168
169 if (fProtocol > 12) {
170#ifdef R__WIN32
171 sscanf(msg, "%ld %ld %d %d %d %I64d %ld %d", &dev, &ino, &mode,
172 &uid, &gid, size, modtime, &islink);
173#else
174 sscanf(msg, "%ld %ld %d %d %d %lld %ld %d", &dev, &ino, &mode,
175 &uid, &gid, size, modtime, &islink);
176#endif
177 if (dev == -1)
178 return 1;
179 if (id)
180 *id = (dev << 24) + ino;
181 if (flags) {
182 *flags = 0;
184 *flags |= 1;
185 if (R_ISDIR(mode))
186 *flags |= 2;
187 if (!R_ISREG(mode) && !R_ISDIR(mode))
188 *flags |= 4;
189 }
190 } else {
191#ifdef R__WIN32
192 sscanf(msg, "%ld %I64d %ld %ld", id, size, flags, modtime);
193#else
194 sscanf(msg, "%ld %lld %ld %ld", id, size, flags, modtime);
195#endif
196 if (*id == -1)
197 return 1;
198 }
199
200 return 0;
201}
202
203////////////////////////////////////////////////////////////////////////////////
204/// Close remote file.
205
207{
208 if (!fSocket) return;
209
210 TFile::Close(opt);
211
212 if (fProtocol > 6)
214
216
217 fD = -1; // so TFile::IsOpen() returns false when in TFile::~TFile
218}
219
220////////////////////////////////////////////////////////////////////////////////
221/// Flush file to disk.
222
224{
226
227 if (fSocket && fWritable)
229}
230
231////////////////////////////////////////////////////////////////////////////////
232/// Initialize a TNetFile object.
233
235{
236 Seek(0);
237
238 TFile::Init(create);
239 fD = -2; // so TFile::IsOpen() returns true when in TFile::~TFile
240}
241
242////////////////////////////////////////////////////////////////////////////////
243/// Retruns kTRUE if file is open, kFALSE otherwise.
244
246{
247 return fSocket == 0 ? kFALSE : kTRUE;
248}
249
250////////////////////////////////////////////////////////////////////////////////
251/// Print some info about the net file.
252
254{
255 const char *fname = fUrl.GetFile();
256 Printf("URL: %s", ((TUrl*)&fUrl)->GetUrl());
257 Printf("Remote file: %s", &fname[1]);
258 Printf("Remote user: %s", fUser.Data());
259 Printf("Title: %s", fTitle.Data());
260 Printf("Option: %s", fOption.Data());
261 Printf("Bytes written: %lld", fBytesWrite);
262 Printf("Bytes read: %lld", fBytesRead);
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// Print error string depending on error code.
267
268void TNetFile::PrintError(const char *where, Int_t err)
269{
270 fErrorCode = err;
271 Error(where, "%s", gRootdErrStr[err]);
272}
273
274////////////////////////////////////////////////////////////////////////////////
275/// Reopen a file with a different access mode, like from READ to
276/// UPDATE or from NEW, CREATE, RECREATE, UPDATE to READ. Thus the
277/// mode argument can be either "READ" or "UPDATE". The method returns
278/// 0 in case the mode was successfully modified, 1 in case the mode
279/// did not change (was already as requested or wrong input arguments)
280/// and -1 in case of failure, in which case the file cannot be used
281/// anymore.
282
284{
285 if (fProtocol < 7) {
286 Error("ReOpen", "operation not supported by remote rootd (protocol = %d)",
287 fProtocol);
288 return 1;
289 }
290
291 return TFile::ReOpen(mode);
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Read specified byte range from remote file via rootd daemon.
296/// Returns kTRUE in case of error.
297
299{
300 if (!fSocket) return kTRUE;
301 if (len == 0)
302 return kFALSE;
303
305
306 Int_t st;
307 if ((st = ReadBufferViaCache(buf, len))) {
308 if (st == 2)
309 return kTRUE;
310 return kFALSE;
311 }
312
315
316 Double_t start = 0;
317 if (gPerfStats) start = TTimeStamp();
318
319 if (fSocket->Send(Form("%lld %d", fOffset, len), kROOTD_GET) < 0) {
320 Error("ReadBuffer", "error sending kROOTD_GET command");
321 result = kTRUE;
322 goto end;
323 }
324
325 Int_t stat, n;
326 EMessageTypes kind;
327
328 fErrorCode = -1;
329 if (Recv(stat, kind) < 0 || kind == kROOTD_ERR) {
330 PrintError("ReadBuffer", stat);
331 result = kTRUE;
332 goto end;
333 }
334
335 while ((n = fSocket->RecvRaw(buf, len)) < 0 && TSystem::GetErrno() == EINTR)
337
338 if (n != len) {
339 Error("ReadBuffer", "error receiving buffer of length %d, got %d", len, n);
340 result = kTRUE;
341 goto end;
342 }
343
344 fOffset += len;
345
346 fBytesRead += len;
347 fReadCalls++;
348#ifdef R__WIN32
351#else
352 fgBytesRead += len;
353 fgReadCalls++;
354#endif
355
356end:
357
358 if (gPerfStats)
359 gPerfStats->FileReadEvent(this, len, start);
360
363
364 return result;
365}
366
367////////////////////////////////////////////////////////////////////////////////
368/// Read specified byte range from remote file via rootd daemon.
369/// Returns kTRUE in case of error.
370
372{
373 SetOffset(pos);
374 return ReadBuffer(buf, len);
375}
376
377////////////////////////////////////////////////////////////////////////////////
378/// Read a list of buffers given in pos[] and len[] and return it in a single
379/// buffer.
380/// Returns kTRUE in case of error.
381
383{
384 if (!fSocket) return kTRUE;
385
386 // If it's an old version of the protocol try the default TFile::ReadBuffers
387 if (fProtocol < 17)
388 return TFile::ReadBuffers(buf, pos, len, nbuf);
389
390 Int_t stat;
391 Int_t blockSize = 262144; //Let's say we transfer 256KB at the time
393 EMessageTypes kind;
394 TString data_buf; // buf to put the info
395
398
399 Double_t start = 0;
400 if (gPerfStats) start = TTimeStamp();
401
402 // Make the string with a list of offsets and lengths
405 for(Int_t i = 0; i < nbuf; i++) {
406 data_buf += pos[i] + fArchiveOffset;
407 data_buf += "-";
408 data_buf += len[i];
409 data_buf += "/";
410 total_len += len[i];
411 }
412
413 // Send the command with the length of the info and number of buffers
414 if (fSocket->Send(Form("%d %d %d", nbuf, data_buf.Length(), blockSize),
415 kROOTD_GETS) < 0) {
416 Error("ReadBuffers", "error sending kROOTD_GETS command");
417 result = kTRUE;
418 goto end;
419 }
420 // Send buffer with the list of offsets and lengths
421 if (fSocket->SendRaw(data_buf, data_buf.Length()) < 0) {
422 Error("ReadBuffers", "error sending buffer");
423 result = kTRUE;
424 goto end;
425 }
426
427 fErrorCode = -1;
428 if (Recv(stat, kind) < 0 || kind == kROOTD_ERR) {
429 PrintError("ReadBuffers", stat);
430 result = kTRUE;
431 goto end;
432 }
433
434 actual_pos = 0;
435 while (actual_pos < total_len) {
437 if (left > blockSize)
438 left = blockSize;
439
440 Int_t n;
441 while ((n = fSocket->RecvRaw(buf + actual_pos, Int_t(left))) < 0 &&
444
445 if (n != Int_t(left)) {
446 Error("GetBuffers", "error receiving buffer of length %d, got %d",
447 Int_t(left), n);
448 result = kTRUE ;
449 goto end;
450 }
451 actual_pos += left;
452 }
453
455 fReadCalls++;
456#ifdef R__WIN32
459#else
461 fgReadCalls++;
462#endif
463
464end:
465
466 if (gPerfStats)
467 gPerfStats->FileReadEvent(this, total_len, start);
468
471
472 // If found problems try the generic implementation
473 if (result) {
474 if (gDebug > 0)
475 Info("ReadBuffers", "Couldnt use the specific implementation, calling TFile::ReadBuffers");
476 return TFile::ReadBuffers(buf, pos, len, nbuf);
477 }
478
479 return result;
480}
481
482////////////////////////////////////////////////////////////////////////////////
483/// Write specified byte range to remote file via rootd daemon.
484/// Returns kTRUE in case of error.
485
487{
488 if (!fSocket || !fWritable) return kTRUE;
489
491
492 Int_t st;
493 if ((st = WriteBufferViaCache(buf, len))) {
494 if (st == 2)
495 return kTRUE;
496 return kFALSE;
497 }
498
500
501 if (fSocket->Send(Form("%lld %d", fOffset, len), kROOTD_PUT) < 0) {
503 Error("WriteBuffer", "error sending kROOTD_PUT command");
504 result = kTRUE;
505 goto end;
506 }
507 if (fSocket->SendRaw(buf, len) < 0) {
509 Error("WriteBuffer", "error sending buffer");
510 result = kTRUE;
511 goto end;
512 }
513
514 Int_t stat;
515 EMessageTypes kind;
516
517 fErrorCode = -1;
518 if (Recv(stat, kind) < 0 || kind == kROOTD_ERR) {
520 PrintError("WriteBuffer", stat);
521 result = kTRUE;
522 goto end;
523 }
524
525 fOffset += len;
526
527 fBytesWrite += len;
528#ifdef R__WIN32
530#else
531 fgBytesWrite += len;
532#endif
533
534end:
536
537 return result;
538}
539
540////////////////////////////////////////////////////////////////////////////////
541/// Return status from rootd server and message kind. Returns -1 in
542/// case of error otherwise 8 (sizeof 2 words, status and kind).
543
545{
546 kind = kROOTD_ERR;
547 status = 0;
548
549 if (!fSocket) return -1;
550
551 Int_t what;
552 Int_t n = fSocket->Recv(status, what);
553 kind = (EMessageTypes) what;
554 return n;
555}
556
557////////////////////////////////////////////////////////////////////////////////
558/// Set position from where to start reading.
559
564
565////////////////////////////////////////////////////////////////////////////////
566/// Connect to remote rootd server.
567
571{
573
574 // Create Authenticated socket
575 Int_t sSize = netopt < -1 ? -netopt : 1;
577 if (url.Contains("root")) {
578 url.Insert(4,"dp");
579 } else {
580 url = "rootdp";
581 }
582 url += TString(Form("://%s@%s:%d",
585 if (!fSocket || (fSocket && !fSocket->IsAuthenticated())) {
586 if (sSize > 1)
587 Error("TNetFile", "can't open %d-stream connection to rootd on "
588 "host %s at port %d", sSize, fUrl.GetHost(), fUrl.GetPort());
589 else
590 Error("TNetFile", "can't open connection to rootd on "
591 "host %s at port %d", fUrl.GetHost(), fUrl.GetPort());
592 *kind = kROOTD_ERR;
593 goto zombie;
594 }
595
596 // Check if rootd supports new options
598 if (forceRead && fProtocol < 5) {
599 Warning("ConnectServer", "rootd does not support \"+read\" option");
601 }
602
603 // Open the file
604 if (fProtocol < 16)
605 // For backward compatibility we need to add a '/' at the beginning
606 fn.Insert(0,"/");
607 if (forceOpen)
608 fSocket->Send(Form("%s %s", fn.Data(),
609 ToLower("f"+fOption).Data()), kROOTD_OPEN);
610 else if (forceRead)
611 fSocket->Send(Form("%s %s", fn.Data(), "+read"), kROOTD_OPEN);
612 else
613 fSocket->Send(Form("%s %s", fn.Data(),
614 ToLower(fOption).Data()), kROOTD_OPEN);
615
617 int tmpstat;
619 *stat = tmpstat;
620 *kind = tmpkind;
621
622 return;
623
624zombie:
625 // error in file opening occured, make this object a zombie
626 MakeZombie();
629}
630
631////////////////////////////////////////////////////////////////////////////////
632/// Create a NetFile object. A net file is the same as a TFile
633/// except that it is being accessed via a rootd server. The url
634/// argument must be of the form: root[k]://host.dom.ain/file.root.
635/// When protocol is "rootk" try using kerberos5 authentication.
636/// If the file specified in the URL does not exist, is not accessable
637/// or can not be created the kZombie bit will be set in the TNetFile
638/// object. Use IsZombie() to see if the file is accessable.
639/// If the remote daemon thinks the file is still connected, while you are
640/// sure this is not the case you can force open the file by preceding the
641/// option argument with an "-", e.g.: "-recreate". Do this only
642/// in cases when you are very sure nobody else is using the file.
643/// To bypass the writelock on a file, to allow the reading of a file
644/// that is being written by another process, explicitly specify the
645/// "+read" option ("read" being the default option).
646/// The netopt argument can be used to specify the size of the tcp window in
647/// bytes (for more info see: http://www.psc.edu/networking/perf_tune.html).
648/// The default and minimum tcp window size is 65535 bytes.
649/// If netopt < -1 then |netopt| is the number of parallel sockets that will
650/// be used to connect to rootd. This option should be used on fat pipes
651/// (i.e. high bandwidth, high latency links). The ideal number of parallel
652/// sockets depends on the bandwidth*delay product. Generally 5-7 is a good
653/// number.
654/// For a description of the option and other arguments see the TFile ctor.
655/// The preferred interface to this constructor is via TFile::Open().
656
657void TNetFile::Create(const char * /*url*/, Option_t *option, Int_t netopt)
658{
659 Int_t tcpwindowsize = 65535;
660
661 fErrorCode = -1;
662 fNetopt = netopt;
663 fOption = option;
664
666 if (option[0] == '-') {
667 fOption = &option[1];
669 }
670 // accept 'f', like 'frecreate' still for backward compatibility
671 if (option[0] == 'F' || option[0] == 'f') {
672 fOption = &option[1];
674 }
675
677 if (!strcasecmp(option, "+read")) {
678 fOption = &option[1];
680 }
681
683
684 if (fOption == "NEW")
685 fOption = "CREATE";
686
687 Bool_t create = (fOption == "CREATE") ? kTRUE : kFALSE;
688 Bool_t recreate = (fOption == "RECREATE") ? kTRUE : kFALSE;
689 Bool_t update = (fOption == "UPDATE") ? kTRUE : kFALSE;
690 if (!create && !recreate && !update) {
691 fOption = "READ";
692 }
693
694 if (!fUrl.IsValid()) {
695 Error("Create", "invalid URL specified: %s", fUrl.GetUrl());
696 goto zombie;
697 }
698
699 if (netopt > tcpwindowsize)
701
702 // Open connection to remote rootd server
703 EMessageTypes kind;
704 Int_t stat;
706 if (gDebug > 2) Info("Create", "got from host %d %d", stat, kind);
707
708 if (kind == kROOTD_ERR) {
709 PrintError("Create", stat);
710 Error("Create", "failing on file %s", fUrl.GetUrl());
711 goto zombie;
712 }
713
714 if (recreate) {
715 create = kTRUE;
716 fOption = "CREATE";
717 }
718
719 if (update && stat > 1) {
720 create = kTRUE;
721 stat = 1;
722 }
723
724 if (stat == 1)
726 else
728
729 Init(create);
730 return;
731
732zombie:
733 // error in file opening occured, make this object a zombie
734 MakeZombie();
737}
738
739////////////////////////////////////////////////////////////////////////////////
740/// Create a NetFile object using an existing connection (socket s).
741/// Provided for use in TNetXNGFile.
742/// See:
743/// TNetFile::Create(const char *url, Option_t *option, Int_t netopt)
744/// for details about the arguments.
745
747{
748 // Import socket
749 fSocket = s;
750
751 // Create the connection
752 Create(s->GetUrl(), option, netopt);
753}
754
755////////////////////////////////////////////////////////////////////////////////
756/// Return kTRUE if 'url' matches the coordinates of this file.
757/// Check the full URL, including port and FQDN.
758
760{
761 // Run standard check on fUrl, first
763 if (rc)
764 // Ok, standard check enough
765 return kTRUE;
766
767 // Check also endpoint URL
768 TUrl u(url);
769 if (!strcmp(u.GetFile(),fEndpointUrl.GetFile())) {
770 // Candidate info
771 TString fqdn = u.GetHostFQDN();
772
773 // Check ports
774 if (u.GetPort() == fEndpointUrl.GetPort()) {
776 if (fqdn == fqdnref)
777 // Ok, coordinates match
778 return kTRUE;
779 }
780 }
781
782 // Default is not matching
783 return kFALSE;
784}
785
786//
787// TNetSystem: the directory handler for net files
788//
789
790////////////////////////////////////////////////////////////////////////////////
791/// Create helper class that allows directory access via rootd.
792/// Use ftpowner = TRUE (default) if this instance is responsible
793/// for cleaning of the underlying TFTP connection; this allows
794/// to have control on the order of the final cleaning.
795
797 : TSystem("-root", "Net file Helper System")
798{
799 // name must start with '-' to bypass the TSystem singleton check
800 SetName("root");
801
802 fDir = kFALSE;
803 fDirp = 0;
804 fFTP = 0;
806 fUser = "";
807 fHost = "";
808 fPort = -1;
810}
811
812////////////////////////////////////////////////////////////////////////////////
813/// Create helper class that allows directory access via rootd.
814/// Use ftpowner = TRUE (default) if this instance is responsible
815/// for cleaning of the underlying TFTP connection; this allows
816/// to have control on the order of the final cleaning.
817
819 : TSystem("-root", "Net file Helper System")
820{
821 // name must start with '-' to bypass the TSystem singleton check
822 SetName("root");
823
826 Create(url);
827}
828
829////////////////////////////////////////////////////////////////////////////////
830/// Parse and save coordinates of the remote entity (user, host, port, ...)
831
833{
834 TUrl turl(url);
835
836 // Remote username: local as default
837 fUser = turl.GetUser();
838 if (!fUser.Length()) {
840 if (u)
841 fUser = u->fUser;
842 delete u;
843 }
844
845 // Check and save the host FQDN ...
846 fHost = turl.GetHostFQDN();
847
848 // Remote port: the default should be 1094 because we are here
849 // only if the protocol is "root://"
850 fPort = turl.GetPort();
851}
852
853////////////////////////////////////////////////////////////////////////////////
854/// Create a TNetSystem object.
855
856void TNetSystem::Create(const char *url, TSocket *sock)
857{
858 // If we got here protocol must be at least its short form "^root.*:" :
859 // make sure that it is in the full form to avoid problems in TFTP
861 if (!surl.Contains("://")) {
862 surl.Insert(surl.Index(":")+1,"//");
863 }
864 TUrl turl(surl);
865
866 fDir = kFALSE;
867 fDirp = 0;
868 fFTP = 0;
869
870 // Check locality, taking into account possible prefixes
871 fLocalPrefix = "";
873 // We may have been asked explicitly to go through the daemon
874 Bool_t forceRemote = gEnv->GetValue("Path.ForceRemote", 0);
876 if (opts.Contains("remote=1"))
878 else if (opts.Contains("remote=0"))
880 if (!forceRemote) {
882 fLocalPrefix = gEnv->GetValue("Path.Localroot","");
883 // Nothing more to do
884 return;
885 }
886 }
887
888 // Fill in user, host, port
890
891 // Build a TFTP url
892 if (fHost.Length()) {
893 TString eurl = "";
894 // First the protocol
895 if (strlen(turl.GetProtocol())) {
896 eurl = turl.GetProtocol();
897 eurl += "://";
898 } else
899 eurl = "root://";
900 // Add user, if specified
901 if (strlen(turl.GetUser())) {
902 eurl += turl.GetUser();
903 eurl += "@";
904 }
905 // Add host
906 eurl += fHost;
907 // Add port
908 eurl += ":";
909 eurl += turl.GetPort();
910
911 fFTP = new TFTP(eurl, 1, TFTP::kDfltWindowSize, sock);
912 if (fFTP && fFTP->IsOpen()) {
913 if (fFTP->GetSocket()->GetRemoteProtocol() < 12) {
914 Error("Create",
915 "remote daemon does not support 'system' functionality");
916 fFTP->Close();
917 delete fFTP;
918 } else {
921 // If responsible for the TFTP connection, remove it from the
922 // socket global list to avoid problems with double deletion
923 // at final cleanup
924 if (fFTPOwner)
925 gROOT->GetListOfSockets()->Remove(fFTP);
926 }
927 }
928 }
929}
930
931////////////////////////////////////////////////////////////////////////////////
932/// Destructor
933
935{
936 // Close FTP connection
937 if (fFTPOwner) {
938 if (fFTP) {
939 if (fFTP->IsOpen()) {
940
941 // Close remote directory if still open
942 if (fDir) {
944 fDir = kFALSE;
945 }
946 fFTP->Close();
947 }
948 delete fFTP;
949 }
950 }
951 fDirp = 0;
952 fFTP = 0;
953}
954
955////////////////////////////////////////////////////////////////////////////////
956/// Make a directory via rootd.
957
959{
960 // If local, use the local TSystem
961 if (fIsLocal) {
962 TString edir = TUrl(dir).GetFile();
963 if (!fLocalPrefix.IsNull())
964 edir.Insert(0, fLocalPrefix);
965 return gSystem->MakeDirectory(edir);
966 }
967
968 if (fFTP && fFTP->IsOpen()) {
969 // Extract the directory name
970 TString edir = TUrl(dir).GetFile();
971 return fFTP->MakeDirectory(edir,kFALSE);
972 }
973 return -1;
974}
975
976////////////////////////////////////////////////////////////////////////////////
977/// Open a directory and return an opaque pointer to a dir structure.
978/// Returns nullptr in case of error.
979
980void *TNetSystem::OpenDirectory(const char *dir)
981{
982 // If local, use the local TSystem
983 if (fIsLocal) {
984 TString edir = TUrl(dir).GetFile();
985 if (!fLocalPrefix.IsNull())
986 edir.Insert(0, fLocalPrefix);
987 return gSystem->OpenDirectory(edir);
988 }
989
990 if (!fFTP || !fFTP->IsOpen())
991 return nullptr;
992
993 if (fDir) {
994 if (gDebug > 0)
995 Info("OpenDirectory", "a directory is already open: close it first");
997 fDir = kFALSE;
998 }
999
1000 // Extract the directory name
1001 TString edir = TUrl(dir).GetFile();
1002
1003 if (fFTP->OpenDirectory(edir,kFALSE)) {
1004 fDir = kTRUE;
1005 fDirp = (void *)&fDir;
1006 return fDirp;
1007 } else
1008 return nullptr;
1009}
1010
1011////////////////////////////////////////////////////////////////////////////////
1012/// Free directory via rootd.
1013
1015{
1016 // If local, use the local TSystem
1017 if (fIsLocal) {
1019 return;
1020 }
1021
1022 if (dirp != fDirp) {
1023 Error("FreeDirectory", "invalid directory pointer (should never happen)");
1024 return;
1025 }
1026
1027 if (fFTP && fFTP->IsOpen()) {
1028 if (fDir) {
1030 fDir = kFALSE;
1031 fDirp = 0;
1032 }
1033 }
1034}
1035
1036////////////////////////////////////////////////////////////////////////////////
1037/// Get directory entry via rootd. Returns 0 in case no more entries.
1038
1040{
1041 // If local, use the local TSystem
1042 if (fIsLocal) {
1043 return gSystem->GetDirEntry(dirp);
1044 }
1045
1046 if (dirp != fDirp) {
1047 Error("GetDirEntry", "invalid directory pointer (should never happen)");
1048 return 0;
1049 }
1050
1051 if (fFTP && fFTP->IsOpen() && fDir) {
1052 return fFTP->GetDirEntry(kFALSE);
1053 }
1054 return 0;
1055}
1056
1057////////////////////////////////////////////////////////////////////////////////
1058/// Get info about a file. Info is returned in the form of a FileStat_t
1059/// structure (see TSystem.h).
1060/// The function returns 0 in case of success and 1 if the file could
1061/// not be stat'ed.
1062
1064{
1065 // If local, use the local TSystem
1066 if (fIsLocal) {
1067 TString epath = TUrl(path).GetFile();
1068 if (!fLocalPrefix.IsNull())
1069 epath.Insert(0, fLocalPrefix);
1070 return gSystem->GetPathInfo(epath, buf);
1071 }
1072
1073 if (fFTP && fFTP->IsOpen()) {
1074 // Extract the directory name
1075 TString epath = TUrl(path).GetFile();
1076 fFTP->GetPathInfo(epath, buf, kFALSE);
1077 return 0;
1078 }
1079 return 1;
1080}
1081
1082////////////////////////////////////////////////////////////////////////////////
1083/// Returns FALSE if one can access a file using the specified access mode.
1084/// Mode is the same as for the Unix access(2) function.
1085/// Attention, bizarre convention of return value!!
1086
1088{
1089 // If local, use the local TSystem
1090 if (fIsLocal) {
1091 TString epath = TUrl(path).GetFile();
1092 if (!fLocalPrefix.IsNull())
1093 epath.Insert(0, fLocalPrefix);
1094 return gSystem->AccessPathName(epath, mode);
1095 }
1096
1097 if (fFTP && fFTP->IsOpen()) {
1098 // Extract the directory name
1099 TString epath = TUrl(path).GetFile();
1100 return fFTP->AccessPathName(epath, mode, kFALSE);
1101 }
1102 return kTRUE;
1103}
1104
1105////////////////////////////////////////////////////////////////////////////////
1106/// Check consistency of this helper with the one required
1107/// by 'path' or 'dirptr'.
1108
1110{
1111 // Standard check: only the protocol part of 'path' is required to match
1113 if (!checkstd) return kFALSE;
1114
1115 // Require match of 'user' and 'host'
1116 Bool_t checknet = path ? kFALSE : kTRUE;
1117 if (path && strlen(path)) {
1118
1119 // Get user name
1120 TUrl url(path);
1121 TString user = url.GetUser();
1122 if (user.IsNull() && !fUser.IsNull()) {
1124 if (u)
1125 user = u->fUser;
1126 delete u;
1127 }
1128
1129 // Get host name
1130 TString host = url.GetHostFQDN();
1131
1132 // Get port
1133 Int_t port = url.GetPort();
1134 if (gDebug > 1)
1135 Info("ConsistentWith", "fUser:'%s' (%s), fHost:'%s' (%s), fPort:%d (%d)",
1136 fUser.Data(), user.Data(), fHost.Data(), host.Data(),
1137 fPort, port);
1138
1139 if (user == fUser && host == fHost && port == fPort)
1140 checknet = kTRUE;
1141 }
1142
1143 return (checkstd && checknet);
1144}
1145
1146////////////////////////////////////////////////////////////////////////////////
1147/// Remove a path
1148
1149Int_t TNetSystem::Unlink(const char *path)
1150{
1151 // If local, use the local TSystem
1152 if (fIsLocal) {
1153 TString epath = TUrl(path).GetFile();
1154 if (!fLocalPrefix.IsNull())
1155 epath.Insert(0, fLocalPrefix);
1156 return gSystem->Unlink(epath);
1157 }
1158
1159 // Not implemented for rootd
1160 Warning("Unlink", "functionality not implemented - ignored (path: %s)", path);
1161 return -1;
1162}
EMessageTypes
@ kROOTD_FSTAT
@ kROOTD_OPEN
@ kROOTD_BYE
@ kROOTD_GET
@ kROOTD_PUT
@ kROOTD_ERR
@ kROOTD_CLOSE
@ kROOTD_FLUSH
@ kROOTD_GETS
R__EXTERN const char * gRootdErrStr[]
Definition NetErrors.h:72
#define SafeDelete(p)
Definition RConfig.hxx:533
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
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gDirectory
Definition TDirectory.h:385
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition TError.cxx:241
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:252
Option_t Option_t option
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
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
Definition TROOT.cxx:627
#define gROOT
Definition TROOT.h:411
TString ToLower(const TString &s)
Return a lower-case version of str.
Definition TString.cxx:1503
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition TString.cxx:2509
EAccessMode
Definition TSystem.h:51
Bool_t R_ISREG(Int_t mode)
Definition TSystem.h:126
Bool_t R_ISDIR(Int_t mode)
Definition TSystem.h:123
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
@ kS_IXOTH
Definition TSystem.h:120
@ kS_IXUSR
Definition TSystem.h:112
@ kS_IXGRP
Definition TSystem.h:116
#define gPerfStats
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.
Definition TEnv.cxx:490
Definition TFTP.h:34
Int_t MakeDirectory(const char *dir, Bool_t print=kFALSE) const
Make a remote directory.
Definition TFTP.cxx:666
void FreeDirectory(Bool_t print=kFALSE)
Free a remotely open directory via rootd.
Definition TFTP.cxx:955
Int_t GetPathInfo(const char *path, FileStat_t &buf, Bool_t print=kFALSE)
Get info about a file.
Definition TFTP.cxx:1028
Bool_t OpenDirectory(const char *name, Bool_t print=kFALSE)
Open a directory via rootd.
Definition TFTP.cxx:913
TSocket * GetSocket() const
Definition TFTP.h:108
const char * GetDirEntry(Bool_t print=kFALSE)
Get directory entry via rootd.
Definition TFTP.cxx:987
Int_t Close()
Close ftp connection.
Definition TFTP.cxx:883
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.
Definition TFTP.cxx:1110
Bool_t IsOpen() const
Definition TFTP.h:85
@ kDfltWindowSize
Definition TFTP.h:70
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:131
static std::atomic< Long64_t > fgBytesRead
Number of bytes read by all TFile objects.
Definition TFile.h:161
Int_t fReadCalls
Number of read calls ( not counting the cache calls )
Definition TFile.h:168
static void SetFileBytesWritten(Long64_t bytes=0)
Definition TFile.cxx:4293
Long64_t fBytesRead
Number of bytes read from this file.
Definition TFile.h:155
virtual Int_t ReOpen(Option_t *mode)
Reopen a file with a different access mode.
Definition TFile.cxx:2192
virtual Bool_t Matches(const char *name)
Return kTRUE if 'url' matches the coordinates of this file.
Definition TFile.cxx:4448
static Long64_t GetFileBytesWritten()
Static function returning the total number of bytes written to all files.
Definition TFile.cxx:4265
static void SetFileBytesRead(Long64_t bytes=0)
Definition TFile.cxx:4290
static void SetFileReadCalls(Int_t readcalls=0)
Definition TFile.cxx:4296
TUrl fUrl
!URL of file
Definition TFile.h:189
Int_t WriteBufferViaCache(const char *buf, Int_t len)
Write buffer via cache.
Definition TFile.cxx:2549
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Definition TFile.cxx:4256
Int_t ReadBufferViaCache(char *buf, Int_t len)
Read buffer via cache.
Definition TFile.cxx:1919
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.
Definition TFile.cxx:1851
Long64_t fArchiveOffset
!Offset at which file starts in archive
Definition TFile.h:180
virtual void Init(Bool_t create)
Initialize a TFile object.
Definition TFile.cxx:616
TString fOption
File options.
Definition TFile.h:170
ERelativeTo
Definition TFile.h:278
Int_t fD
File descriptor.
Definition TFile.h:161
Bool_t FlushWriteCache()
Flush the write cache if active.
Definition TFile.cxx:1147
Long64_t fBytesWrite
Number of bytes written to this file.
Definition TFile.h:154
virtual void SetOffset(Long64_t offset, ERelativeTo pos=kBeg)
Set position from where to start reading.
Definition TFile.cxx:2283
Long64_t fOffset
!Seek offset cache
Definition TFile.h:175
static std::atomic< Long64_t > fgBytesWrite
Number of bytes written by all TFile objects.
Definition TFile.h:162
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:958
static std::atomic< Int_t > fgReadCalls
Number of bytes read from all TFile objects.
Definition TFile.h:164
@ kWriteError
Definition TFile.h:269
static Int_t GetFileReadCalls()
Static function returning the total number of read calls from all files.
Definition TFile.cxx:4273
TString fTitle
Definition TNamed.h:33
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
void Init(Bool_t create) override
Initialize a TNetFile object.
Definition TNetFile.cxx:234
Bool_t ReadBuffer(char *buf, Int_t len) override
Read specified byte range from remote file via rootd daemon.
Definition TNetFile.cxx:298
Bool_t WriteBuffer(const char *buf, Int_t len) override
Write specified byte range to remote file via rootd daemon.
Definition TNetFile.cxx:486
Bool_t Matches(const char *url) override
Return kTRUE if 'url' matches the coordinates of this file.
Definition TNetFile.cxx:759
virtual void Create(const char *url, Option_t *option, Int_t netopt)
Create a NetFile object.
Definition TNetFile.cxx:657
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) override
Return file stat information.
Definition TNetFile.cxx:154
Int_t fProtocol
Definition TNetFile.h:40
Int_t SysClose(Int_t fd) override
Close currently open file.
Definition TNetFile.cxx:142
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.
Definition TNetFile.cxx:568
void Print(Option_t *option) const override
Print some info about the net file.
Definition TNetFile.cxx:253
Bool_t IsOpen() const override
Retruns kTRUE if file is open, kFALSE otherwise.
Definition TNetFile.cxx:245
Int_t Recv(Int_t &status, EMessageTypes &kind)
Return status from rootd server and message kind.
Definition TNetFile.cxx:544
Int_t ReOpen(Option_t *mode) override
Reopen a file with a different access mode, like from READ to UPDATE or from NEW, CREATE,...
Definition TNetFile.cxx:283
TNetFile()
Definition TNetFile.h:64
TUrl fEndpointUrl
Definition TNetFile.h:37
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.
Definition TNetFile.cxx:382
TString fUser
Definition TNetFile.h:38
void Flush() override
Flush file to disk.
Definition TNetFile.cxx:223
void PrintError(const char *where, Int_t err)
Print error string depending on error code.
Definition TNetFile.cxx:268
Int_t fNetopt
Definition TNetFile.h:42
void Seek(Long64_t offset, ERelativeTo pos=kBeg) override
Set position from where to start reading.
Definition TNetFile.cxx:560
Int_t fErrorCode
Definition TNetFile.h:41
void Close(Option_t *option="") override
Close remote file.
Definition TNetFile.cxx:206
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override
Open a remote file. Requires fOption to be set correctly.
Definition TNetFile.cxx:107
virtual ~TNetFile()
TNetFile dtor. Send close message and close socket.
Definition TNetFile.cxx:99
TSocket * fSocket
Definition TNetFile.h:39
TString fLocalPrefix
Definition TNetFile.h:103
void Create(const char *url, TSocket *sock=nullptr)
Create a TNetSystem object.
Definition TNetFile.cxx:856
Int_t MakeDirectory(const char *name) override
Make a directory via rootd.
Definition TNetFile.cxx:958
TString fHost
Definition TNetFile.h:91
TString fUser
Definition TNetFile.h:93
TNetSystem(const TNetSystem &)=delete
void InitRemoteEntity(const char *url)
Parse and save coordinates of the remote entity (user, host, port, ...)
Definition TNetFile.cxx:832
Bool_t fDir
Definition TNetFile.h:88
int Unlink(const char *path) override
Remove a path.
virtual ~TNetSystem()
Destructor.
Definition TNetFile.cxx:934
void * fDirp
Definition TNetFile.h:89
Bool_t ConsistentWith(const char *path, void *dirptr) override
Check consistency of this helper with the one required by 'path' or 'dirptr'.
Bool_t fFTPOwner
Definition TNetFile.h:92
TFTP * fFTP
Definition TNetFile.h:90
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.
Int_t fPort
Definition TNetFile.h:94
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.
Bool_t fIsLocal
Definition TNetFile.h:102
void * OpenDirectory(const char *name) override
Open a directory and return an opaque pointer to a dir structure.
Definition TNetFile.cxx:980
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1057
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:864
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
void MakeZombie()
Definition TObject.h:53
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:1045
const char * GetHost() const
Definition TSecContext.h:75
const char * GetUser() const
Definition TSecContext.h:82
void HandleDelayedSignal()
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
Definition TSocket.cxx:809
Int_t GetRemoteProtocol() const
Definition TSocket.h:124
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
Definition TSocket.cxx:889
TSecContext * GetSecContext() const
Definition TSocket.h:125
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
Definition TSocket.cxx:611
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...
Definition TSocket.cxx:1398
const char * GetUrl() const
Definition TSocket.h:128
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
Definition TSocket.cxx:513
virtual Bool_t IsAuthenticated() const
Definition TSocket.h:129
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:425
const char * Data() const
Definition TString.h:384
void ToUpper()
Change string to upper case.
Definition TString.cxx:1202
Bool_t IsNull() const
Definition TString.h:422
Abstract base class defining a generic interface to the underlying Operating System.
Definition TSystem.h:276
virtual void IgnoreInterrupt(Bool_t ignore=kTRUE)
If ignore is true ignore the interrupt signal, else restore previous behaviour.
Definition TSystem.cxx:600
static void ResetErrno()
Static function resetting system error number.
Definition TSystem.cxx:282
static Int_t GetErrno()
Static function returning system error number.
Definition TSystem.cxx:274
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition TSystem.cxx:855
virtual void * OpenDirectory(const char *name)
Open a directory.
Definition TSystem.cxx:846
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
Definition TSystem.cxx:1316
virtual int MakeDirectory(const char *name)
Make a directory.
Definition TSystem.cxx:836
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.
Definition TSystem.cxx:1409
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition TSystem.cxx:1307
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition TSystem.cxx:863
virtual int Unlink(const char *name)
Unlink, i.e.
Definition TSystem.cxx:1392
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition TSystem.cxx:1612
virtual Bool_t ConsistentWith(const char *path, void *dirptr=nullptr)
Check consistency of this helper with the one required by 'path' or 'dirptr'.
Definition TSystem.cxx:813
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition TTimeStamp.h:45
This class represents a WWW compatible URL.
Definition TUrl.h:33
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition TUrl.cxx:395
const char * GetFile() const
Definition TUrl.h:69
Bool_t IsValid() const
Definition TUrl.h:79
const char * GetUser() const
Definition TUrl.h:65
const char * GetHost() const
Definition TUrl.h:67
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Definition TUrl.cxx:476
const char * GetOptions() const
Definition TUrl.h:71
const char * GetProtocol() const
Definition TUrl.h:64
Int_t GetPort() const
Definition TUrl.h:78
const Int_t n
Definition legend1.C:16
static const char * what
Definition stlLoader.cc:5