Logo ROOT   6.14/05
Reference Guide
TAlienFile.cxx
Go to the documentation of this file.
1 // @(#)root/alien:$Id$
2 // Author: Andreas Peters 11/09/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2003, 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 // //
14 // TAlienFile //
15 // //
16 // A TAlienFile is like a normal TFile except that it reads and writes //
17 // it's data via TXNetFile and gets authorization and the TXNetFile //
18 // URL from an alien service. //
19 // //
20 // Filenames are standard URL format with protocol "alien". //
21 // The following are valid TAlienFile URL's: //
22 // //
23 // alien:///alice/cern.ch/user/p/peters/test.root //
24 // /alien/alice/cern.ch/user/p/peters/test.root //
25 // //
26 // - notice that URLs like /alien/alice... are converted internally //
27 // to alien://alice... //
28 // //
29 //////////////////////////////////////////////////////////////////////////
30 
31 #include "TAlienFile.h"
32 #include "TAlienResult.h"
33 #include "TAlien.h"
34 #include "TROOT.h"
35 #include "TObjString.h"
36 #include "TMap.h"
37 #include "TObjArray.h"
38 #include "TString.h"
39 #include "Rtypes.h"
40 #include "TSystem.h"
41 #include "TStopwatch.h"
42 #include "TVirtualMonitoring.h"
43 #include "TVirtualMutex.h"
44 #include "TProcessUUID.h"
45 #include "TUrl.h"
46 #include "TError.h"
47 #include <cstdlib>
48 
50 
51 #define MAX_FILE_IMAGES 16
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Create an Alien File Object. An AliEn File is the same as a TFile
55 /// except that its real tranfer URL is resolved via an Alien service. The url
56 /// argument must be of the form: alien:/[machine]/path/file.root
57 /// Using the option access, another access protocol (PFN) can be
58 /// specified for an LFN e.g.:
59 /// "alien:///alice/test.root"
60 /// If you want to write a file on specific storage element use the syntax
61 /// "alien:///alice/test.root?&se=Alice::CERN::Storage"
62 /// The default SE is specified by the environment variable alien_CLOSE_SE
63 ///
64 /// If you read a file, the closest file image to alien_CLOSE_SE is taken.
65 /// If the file cannot opened from the closest image, the next image is tried,
66 /// until there is no image location left to be tried.
67 ///
68 /// If the file specified in the URL does not exist, is not accessable
69 /// or can not be created the kZombie bit will be set in the TAlienFile
70 /// object. Use IsZombie() to see if the file is accessable.
71 /// For a description of the option and other arguments see the TFile ctor.
72 /// The preferred interface to this constructor is via TFile::Open().
73 ///
74 /// Warning: TAlienFile objects should only be created through the factory functions:
75 /// TFile::Open("alien://...");
76 /// or
77 /// TAlienFile::Open("alien://...");
78 ///
79 /// Don't use "new TAlienFile" directly unless you know, what you are doing
80 ///
81 
82 TAlienFile::TAlienFile(const char *purl, Option_t *option,
83  const char *ftitle, Int_t compress,
84  Bool_t parallelopen, const char *lurl,
85  const char *authz) :
86  TXNetFile(purl, option, ftitle, compress, 0, parallelopen, lurl)
87 {
88  TUrl logicalurl(lurl);
89  fLfn = logicalurl.GetFile();
90  fAuthz = authz;
91  fGUID = "";
92  fUrl = "";
93  fPfn = "";
94  fSE = "";
95  fImage = 0;
96  fNreplicas = 0;
97  fOpenedAt = time(0);
98 }
99 
100 ////////////////////////////////////////////////////////////////////////////////
101 /// Static method used to create a TAlienFile object. For options see
102 /// TAlienFile ctor.
103 
104 TAlienFile *TAlienFile::Open(const char *url, Option_t *option,
105  const char *ftitle, Int_t compress,
106  Bool_t parallelopen)
107 {
108  if (!gGrid) {
109  ::Error("TAlienFileAccess", "No GRID connection available!");
110  return 0;
111  }
112  TUrl lUrl(url);
113 
114  // Report this open phase as a temp one, since we have no object yet
115  if (gMonitoringWriter)
116  gMonitoringWriter->SendFileOpenProgress(0, 0, "alienopen", kFALSE);
117 
118  TString name(TString("alien://") + TString(lUrl.GetFile()));
119  TString fAName = name;
120  TString fAOption = option;
121  TUrl fAUrl;
122  TString sguid, pfnStr;
123  Int_t nreplicas = 0;
124  Bool_t fAWritable;
125  fAWritable = kFALSE;
126  TString authz;
127 
128  // Access a URL.
129 
130  TString stmp;
131  Bool_t create;
132  Bool_t recreate;
133  Bool_t update;
134  Bool_t read;
135 
136  TUrl purl(url);
137 
138  // find out the storage element and the lfn from the given url
139  TString storageelement;
140  storageelement = "";
141  TString file = purl.GetFile();
142 
143  Bool_t publicaccess = kFALSE;
144  storageelement = gSystem->Getenv("alien_CLOSE_SE");
145 
146  // get the options and set the storage element
147  TString urloptions = purl.GetOptions();
148  TObjArray *objOptions = urloptions.Tokenize("&");
149  for (Int_t n = 0; n < objOptions->GetEntries(); n++) {
150  TString loption = ((TObjString *) objOptions->At(n))->GetName();
151  TObjArray *objTags = loption.Tokenize("=");
152  if (objTags->GetEntries() == 2) {
153  TString key = ((TObjString *) objTags->At(0))->GetName();
154  TString value = ((TObjString *) objTags->At(1))->GetName();
155  if (!key.CompareTo("se", TString::kIgnoreCase)) {
156  storageelement = value;
157  }
158  if (!key.CompareTo("publicaccess")) {
159  if (atoi(value.Data()))
160  publicaccess = kTRUE;
161  }
162  }
163  delete objTags;
164  }
165  delete objOptions;
166 
167  fAOption = option;
168  fAOption.ToUpper();
169 
170  TObjString *urlStr = 0;
171  TString urlStrs;
172  TObjString *authzStr = 0;
173  TObjString *seStr = 0;
174  TString seStrs, snreplicas;
175 
176  TString command;
177  TString repcommand;
178  TIterator *iter = 0;
179  TObject *object = 0;
180 
181  TGridResult *result;
182  TAlienResult *alienResult;
183  TList *list;
184 
185  TString stringurl;
186  TString anchor;
187  TObjArray *tokens;
188  anchor = "";
189 
190  TString newurl;
191  if (fAOption == "NEW")
192  fAOption = "CREATE";
193 
194  create = (fAOption == "CREATE") ? kTRUE : kFALSE;
195  recreate = (fAOption == "RECREATE") ? kTRUE : kFALSE;
196  update = (fAOption == "UPDATE") ? kTRUE : kFALSE;
197  read = (fAOption == "READ") ? kTRUE : kFALSE;
198 
199  if (!create && !recreate && !update && !read) {
200  read = kTRUE;
201  fAOption = "READ";
202  }
203 
204  if (create || recreate || update) {
205  fAWritable = kTRUE;
206  }
207 
208  if (recreate) {
209  fAOption = "RECREATE";
210  create = kTRUE;
211  }
212  /////////////////////////////////////////////////////////////////////////////////////////
213  // first get an active Grid connection
214 
215  if (!gGrid) {
216  // no TAlien existing ....
217  ::Error("TAlienFile::Open", "no active GRID connection found");
218  fAUrl = "";
219 
220  // Reset the temp monitoring info
221  if (gMonitoringWriter)
223 
224  return 0;
225  } else {
226  if ((strcmp(gGrid->GetGrid(), "alien"))) {
227  ::Error("TAlienFile::Open", "you don't have an active <alien> grid!");
228  fAUrl = "";
229 
230  // Reset the temp monitoring info
231  if (gMonitoringWriter)
233 
234  return 0;
235  }
236  }
237 
238  /////////////////////////////////////////////////////////////////////////////////////////
239  // get the authorization from the catalogue
240 
241  if (read) {
242  // get the read access
243  if (publicaccess)
244  command = TString("access -p read ");
245  else
246  command = TString("access read ");
247  }
248 
249  if (create) {
250  command = TString("access write-once ");
251  }
252 
253  if (recreate) {
254  command = TString("access write-version ");
255  }
256 
257  if (update) {
258  command = TString("access write-version ");
259  }
260 
261  command += file;
262 
263  if (fAWritable) {
264  // append the storage element environment variable
265  command += " ";
266  command += storageelement;
267  }
268 
269  TString fALfn = file;
270 
271  int imagenr = 0;
272 
273  do {
274  imagenr++;
275  repcommand = command;
276  if (!fAWritable) {
277  // in the read case, try all image locations
278  if (storageelement != "") {
279  repcommand += " ";
280  repcommand += storageelement;
281  } else {
282  repcommand += " ";
283  repcommand += "unknown";
284  }
285  repcommand += " 0 ";
286  repcommand += imagenr;
287  }
288 
289  if (gSystem->Getenv("ALIEN_SITE")) {
290  repcommand += " 0 ";
291  repcommand += gSystem->Getenv("ALIEN_SITE");
292  }
293  result = gGrid->Command(repcommand.Data(), kFALSE, TAlien::kOUTPUT);
294  alienResult = dynamic_cast < TAlienResult * >(result);
295  list = dynamic_cast < TList * >(alienResult);
296  if (!list) {
297 
298  if (seStr)
299  ::Error("TAlienFile::Open",
300  "cannot get the access envelope for %s and image %u in SE <%s>",
301  purl.GetUrl(), imagenr, seStr->GetName());
302  else
303  ::Error("TAlienFile::Open",
304  "cannot get the access envelope for %s and image %u",
305  purl.GetUrl(), imagenr);
306  fAUrl = "";
307  if (result) {
308  delete result;
309  }
310 
311  // Reset the temp monitoring info
312  if (gMonitoringWriter)
314 
315  return 0;
316  }
317 
318  iter = list->MakeIterator();
319  object = 0;
320 
321  Bool_t imageeof = kFALSE;
322 
323  while ((object = iter->Next()) != 0) {
324  TMap *map = dynamic_cast < TMap * >(object);
325 
326  TObject *urlObject = map->GetValue("url");
327  urlStr = dynamic_cast < TObjString * >(urlObject);
328  if (urlStr) urlStrs = urlStr->GetName();
329 
330  TObject *authzObject = map->GetValue("envelope");
331  authzStr = dynamic_cast < TObjString * >(authzObject);
332 
333  TObject *seObject = map->GetValue("se");
334  seStr = dynamic_cast < TObjString * >(seObject);
335  if (seStr) seStrs = seStr->GetName();
336 
337  TObject *nreplicasObject = map->GetValue("nSEs");
338  if (nreplicasObject) {
339  snreplicas = nreplicasObject->GetName();
340  nreplicas = snreplicas.Atoi();
341  }
342 
343  TObject *guidObject = map->GetValue("guid");
344  if (guidObject) sguid = guidObject->GetName();
345 
346  TObject *pfnObject = map->GetValue("pfn");
347  if (pfnObject) pfnStr = pfnObject->GetName();
348 
349  if (map->GetValue("eof")) {
350  imageeof = kTRUE;
351  // there is only one result line .... in case it is at all ....
352  }
353  break;
354  }
355 
356  if ((!urlStr) || (!authzStr)) {
357  if (fAWritable) {
358  ::Error("TAlienFile::Open",
359  "didn't get the authorization to write %s",
360  purl.GetUrl());
361  } else {
362  if (!imageeof) {
363  ::Error("TAlienFile::Open",
364  "didn't get the authorization to read %s from location %u",
365  purl.GetUrl(), imagenr);
366  }
367  }
368  if (!imageeof) {
369  ::Info("TAlienFile::Open",
370  "Command::Stdout !!!");
371  gGrid->Stdout();
372  ::Info("TAlienFile::Open",
373  "Command::Stderr !!!");
374  gGrid->Stderr();
375  ::Info("TAlienFile::Open",
376  "End of Output !!!");
377  }
378  delete iter;
379  delete result;
380  fAUrl = "";
381  if (!imageeof) {
382  continue;
383  } else {
384  // if the service signals eof, it makes no sense to check more replicas
385  ::Error("TAlienFile::Open",
386  "No more images to try - giving up");
387 
388  // Reset the temp monitoring info
389  if (gMonitoringWriter)
391 
392  return 0;
393  }
394  }
395 
396  delete iter;
397 
398  authz = authzStr->GetName();
399  stringurl = urlStr->GetName();
400 
401  tokens = stringurl.Tokenize("#");
402 
403  if (tokens->GetEntries() == 2) {
404  anchor = ((TObjString *) tokens->At(1))->GetName();
405  urlStr->SetString(((TObjString *) tokens->At(0))->GetName());
406  }
407 
408  delete tokens;
409 
410  newurl = urlStr->GetName();
411  stmp = purl.GetAnchor();
412  newurl += TString("?&authz=");
413  newurl += authzStr->GetName();
414 
415  if (!fAWritable) {
416  if (seStr)
417  ::Info("TAlienFile::Open", "Accessing image %u of %s in SE <%s>",
418  imagenr, purl.GetUrl(), seStr->GetName());
419  else
420  ::Info("TAlienFile::Open", "Accessing image %u of %s", imagenr, purl.GetUrl());
421  }
422  // the treatement of ZIP files is done in the following way:
423  // LFNs in AliEn pointing to files in ZIP archives don't contain the .zip suffix in the file name
424  // to tell TArchiveFile about the ZIP nature, we add to the URL options 'zip=<member>'
425  // This options are not visible in the file name, they are passed through TXNetFile to TNetFile to TArchiveFile
426 
427  if (stmp != "") {
428  newurl += "#";
429  newurl += purl.GetAnchor();
430  TString lUrlfile = lUrl.GetFile();
431  TString lUrloption;
432  lUrloption = "zip=";
433  lUrloption += purl.GetAnchor();
434  lUrloption += "&mkpath=1";
435  lUrl.SetFile(lUrlfile);
436  lUrl.SetOptions(lUrloption);
437  } else {
438  if (anchor.Length()) {
439  newurl += "#";
440  newurl += anchor;
441  TString lUrlfile = lUrl.GetFile();
442  TString lUrloption;
443  lUrloption = "zip=";
444  lUrloption += anchor;
445  lUrloption += "&mkpath=1";
446  lUrl.SetFile(lUrlfile);
447  // lUrl.SetAnchor(anchor);
448  lUrl.SetOptions(lUrloption);
449  } else {
450  TString loption;
451  loption = lUrl.GetOptions();
452  if (loption.Length()) {
453  loption += "&mkpath=1";
454  lUrl.SetOptions(loption.Data());
455  } else {
456  lUrl.SetOptions("mkpath=1");
457  }
458  }
459  }
460 
461  fAUrl = TUrl(newurl);
462 
463  // append the original options
464  TString oldopt;
465  TString newopt;
466 
467  if (TString(fAUrl.GetUrl()) == "") {
468  // error in file opening occured
469 
470  // Reset the temp monitoring info
471  if (gMonitoringWriter)
473 
474  return 0;
475  }
476 
477  TUrl nUrl = fAUrl;
478  TUrl oUrl(url);
479 
480  oldopt = oUrl.GetOptions();
481  newopt = nUrl.GetOptions();
482 
483  // add the original options from the alien URL
484  if (oldopt.Length()) {
485  nUrl.SetOptions(newopt + TString("&") + oldopt);
486  } else {
487  nUrl.SetOptions(newopt);
488  }
489 
490  fAUrl = nUrl;
491  delete result;
492  if (gDebug > 1)
493  ::Info("TAlienFile","Opening AUrl <%s> lUrl <%s>",fAUrl.GetUrl(),lUrl.GetUrl());
494  TStopwatch timer;
495  timer.Start();
496  TAlienFile *alienfile =
497  new TAlienFile(fAUrl.GetUrl(), fAOption, ftitle, compress,
498  parallelopen, lUrl.GetUrl(), authz);
499  timer.Stop();
500  if (alienfile->IsZombie()) {
501  delete alienfile;
502  if (fAWritable) {
503  // for the moment we support only 1 try during writing - no alternative locations
504  break;
505  }
506  continue;
507  } else {
508  alienfile->SetSE(seStrs);
509  alienfile->SetPfn(pfnStr);
510  alienfile->SetImage(imagenr);
511  alienfile->SetNreplicas(nreplicas);
512  alienfile->SetGUID(sguid);
513  alienfile->SetUrl(urlStrs);
514  alienfile->SetElapsed(timer.RealTime());
515  return alienfile;
516  }
517  } while (imagenr < MAX_FILE_IMAGES);
518 
519  if (!fAWritable) {
520  ::Error("TAlienFile::Open",
521  "Couldn't open any of the file images of %s", lUrl.GetUrl());
522  }
523 
524  // Reset the temp monitoring info
525  if (gMonitoringWriter)
527 
528  return 0;
529 }
530 
531 ////////////////////////////////////////////////////////////////////////////////
532 /// TAlienFile file dtor.
533 
535 {
536  if (IsOpen()) {
537  Close();
538  }
539  if (gDebug)
540  Info("~TAlienFile", "dtor called for %s", GetName());
541 }
542 
543 ////////////////////////////////////////////////////////////////////////////////
544 /// Close the file.
545 
547 {
548  if (!IsOpen()) return;
549 
550 
551  // Close file
552  TXNetFile::Close(option);
553 
554  if (fOption == "READ")
555  return;
556 
557  // set GCLIENT_EXTRA_ARG environment
558  gSystem->Setenv("GCLIENT_EXTRA_ARG", fAuthz.Data());
559 
560  // commit the envelope
561  TString command("commit ");
562 
563  Long64_t siz = GetSize();
564  if (siz <= 0)
565  Error("Close", "the reported size of the written file is <= 0");
566 
567  command += siz;
568  command += " ";
569  command += fLfn;
570 
571  TGridResult *result = gGrid->Command(command, kFALSE, TAlien::kOUTPUT);
572  TAlienResult *alienResult = dynamic_cast < TAlienResult * >(result);
573  TList *list = dynamic_cast < TList * >(alienResult);
574  if (!list) {
575  if (result) {
576  delete result;
577  }
578  Error("Close", "cannot commit envelope for %s", fLfn.Data());
579  gSystem->Unlink(fLfn);
580  }
581  TIterator *iter = list->MakeIterator();
582  TObject *object = 0;
583  if (fWritable) {
584  while ((object = iter->Next()) != 0) {
585  TMap *map = dynamic_cast < TMap * >(object);
586  TObject *commitObject = map->GetValue(fLfn.Data());
587  if (commitObject) {
588  TObjString *commitStr =
589  dynamic_cast < TObjString * >(commitObject);
590  if (!(strcmp(commitStr->GetName(), "1"))) {
591  // the file has been committed
592  break;
593  }
594  }
595 
596  Error("Close", "cannot register %s!", fLfn.Data());
597  gSystem->Unlink(fLfn);
598  // there is only one result line .... in case it is at all ....
599  break;
600  }
601  }
602  delete iter;
603  delete result;
604 
605  gSystem->Unsetenv("GCLIENT_EXTRA_ARG");
606 
607 }
608 
609 ////////////////////////////////////////////////////////////////////////////////
610 /// Get surl from lfn by asking AliEn catalog.
611 
612 TString TAlienFile::SUrl(const char *lfn)
613 {
614  TString command;
615  TString surl;
616 
617  if (!lfn) {
618  return surl;
619  }
620 
621  TUrl lurl(lfn);
622  command = "access -p read ";
623  command += lurl.GetFile();
624 
625  TGridResult* result;
626 
627  if (!gGrid) {
628  ::Error("TAlienFile::SUrl","no grid connection");
629  return surl;
630  }
631 
632  result = gGrid->Command(command.Data(), kFALSE, TAlien::kOUTPUT);
633  if (!result) {
634  ::Error("TAlienFile::SUrl","couldn't get access URL for alien file %s", lfn);
635  return surl;
636  }
637 
638  TIterator *iter = result->MakeIterator();
639  TObject *object=0;
640  TObjString *urlStr=0;
641 
642  object = iter->Next();
643  if (object) {
644  TMap *map = dynamic_cast < TMap * >(object);
645  TObject *urlObject = map->GetValue("url");
646  urlStr = dynamic_cast < TObjString * >(urlObject);
647 
648  if (urlStr) {
649  surl = urlStr->GetName();
650  delete object;
651  return surl;
652  }
653  }
654 
655  ::Error("TAlienFile::SUrl","couldn't get surl for alien file %s", lfn);
656  return surl;
657 }
void SetFile(const char *file)
Definition: TUrl.h:88
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
An array of TObjects.
Definition: TObjArray.h:37
virtual void Close(const Option_t *opt="")
Close the file.
Definition: TAlienFile.cxx:546
static TAlienFile * Open(const char *lfn, const Option_t *option="", const char *title="", Int_t compress=1, Bool_t parallelopen=kFALSE)
Static method used to create a TAlienFile object.
Definition: TAlienFile.cxx:104
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:854
long long Long64_t
Definition: RtypesCore.h:69
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Definition: TStopwatch.cxx:58
Collectable string class.
Definition: TObjString.h:28
const char Option_t
Definition: RtypesCore.h:62
R__EXTERN TGrid * gGrid
Definition: TGrid.h:129
TString fGUID
Definition: TAlienFile.h:44
This class represents a WWW compatible URL.
Definition: TUrl.h:35
virtual Bool_t SendFileOpenProgress(TFile *, TList *, const char *, Bool_t=kFALSE)
void SetPfn(const char *pfn)
Definition: TAlienFile.h:77
void SetElapsed(Double_t real)
Definition: TAlienFile.h:74
void ToUpper()
Change string to upper case.
Definition: TString.cxx:1113
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char * GetOptions() const
Definition: TUrl.h:74
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
TString fSE
Definition: TAlienFile.h:47
TString fPfn
Definition: TAlienFile.h:46
Int_t fImage
Definition: TAlienFile.h:48
Iterator abstract base class.
Definition: TIterator.h:30
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:387
const char * GetFile() const
Definition: TUrl.h:72
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Definition: TSystem.cxx:1357
void SetSE(const char *se)
Definition: TAlienFile.h:78
R__EXTERN TVirtualMonitoringWriter * gMonitoringWriter
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1638
void Info(const char *location, const char *msgfmt,...)
const char * GetAnchor() const
Definition: TUrl.h:73
void Error(const char *location, const char *msgfmt,...)
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TList.cxx:718
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:134
A doubly linked list.
Definition: TList.h:44
const char * GetName() const
Returns name of object.
Definition: TObjString.h:39
TString fUrl
Definition: TAlienFile.h:45
virtual void Setenv(const char *name, const char *value)
Set environment variable.
Definition: TSystem.cxx:1622
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
Ssiz_t Length() const
Definition: TString.h:405
void SetNreplicas(Int_t nrep)
Definition: TAlienFile.h:76
virtual void Stderr()
Definition: TGrid.h:71
virtual void Unsetenv(const char *name)
Unset environment variable.
Definition: TSystem.cxx:1630
Bool_t fWritable
True if directory is writable.
Long64_t fOpenedAt
Definition: TAlienFile.h:50
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual ~TAlienFile()
TAlienFile file dtor.
Definition: TAlienFile.cxx:534
const char * GetGrid() const
Definition: TGrid.h:61
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2172
void SetGUID(const char *guid)
Definition: TAlienFile.h:73
#define ClassImp(name)
Definition: Rtypes.h:359
virtual Bool_t IsOpen() const
Return kTRUE if the file is open, kFALSE otherwise.
Definition: TXNetFile.cxx:983
virtual void Close(const Option_t *opt="")
Close the file (see TNetFile::Close() or TFile::Close() for more details).
Definition: TXNetFile.cxx:1037
void SetImage(Int_t image)
Definition: TAlienFile.h:75
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40
virtual Long64_t GetSize() const
Returns the current file size.
Definition: TFile.cxx:1298
TString fOption
File options.
Definition: TFile.h:85
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition: TString.cxx:406
Mother of all ROOT objects.
Definition: TObject.h:37
Definition: file.py:1
virtual TObject * Next()=0
void SetOptions(const char *opt)
Definition: TUrl.h:90
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
R__EXTERN Int_t gDebug
Definition: Rtypes.h:86
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:235
Int_t Atoi() const
Return integer value of string.
Definition: TString.cxx:1896
Int_t fNreplicas
Definition: TAlienFile.h:49
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
void SetString(const char *s)
Definition: TObjString.h:46
virtual TGridResult * Command(const char *, Bool_t=kFALSE, UInt_t=2)
Definition: TGrid.h:73
const Bool_t kTRUE
Definition: RtypesCore.h:87
static TString SUrl(const char *lfn)
Get surl from lfn by asking AliEn catalog.
Definition: TAlienFile.cxx:612
virtual void Stdout()
Definition: TGrid.h:70
TString fLfn
Definition: TAlienFile.h:42
TString fAuthz
Definition: TAlienFile.h:43
const Int_t n
Definition: legend1.C:16
char name[80]
Definition: TGX11.cxx:109
void SetUrl(const char *url)
Definition: TAlienFile.h:79
const char * Data() const
Definition: TString.h:364
#define MAX_FILE_IMAGES
Definition: TAlienFile.cxx:51
Stopwatch class.
Definition: TStopwatch.h:28