Logo ROOT  
Reference Guide
TProofServLite.cxx
Go to the documentation of this file.
1// @(#)root/proofx:$Id$
2// Author: Gerardo Ganis 12/12/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, 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/** \class TProofServLite
13\ingroup proofkernel
14
15Version of the PROOF worker server for local running. The client starts
16directly the desired number of these workers; the master and daemons are
17eliminated, optimizing the number of messages exchanged and created / destroyed.
18
19*/
20
21//////////////////////////////////////////////////////////////////////////
22// //
23// TProofServLite //
24// //
25// TProofServLite is the version of the PROOF worker server for local //
26// running. The client starts directly the desired number of these //
27// workers; the master and daemons are eliminated, optimizing the number//
28// of messages exchanged and created / destroyed. //
29// //
30//////////////////////////////////////////////////////////////////////////
31
32#include "RConfigure.h"
33#include <ROOT/RConfig.hxx>
34#include "Riostream.h"
35
36#ifdef WIN32
37 #include <io.h>
38 typedef long off_t;
39 #include <snprintf.h>
40#else
41#include <netinet/in.h>
42#endif
43#include <sys/types.h>
44#include <cstdlib>
45
46#include "TProofServLite.h"
47#include "TEnv.h"
48#include "TError.h"
49#include "TException.h"
50#include "THashList.h"
51#include "TInterpreter.h"
52#include "TMessage.h"
53#include "TProofDebug.h"
54#include "TProof.h"
55#include "TVirtualProofPlayer.h"
56#include "TProofQueryResult.h"
57#include "TRegexp.h"
58#include "TClass.h"
59#include "TROOT.h"
60#include "TSystem.h"
61#include "TPluginManager.h"
62#include "TSocket.h"
63#include "TTimeStamp.h"
64#include "compiledata.h"
65
66using namespace std;
67
68// debug hook
69static volatile Int_t gProofServDebug = 1;
70
71//----- Interrupt signal handler -----------------------------------------------
72////////////////////////////////////////////////////////////////////////////////
73
76public:
79 Bool_t Notify();
80};
81
82////////////////////////////////////////////////////////////////////////////////
83/// Handle urgent data
84
86{
88 if (TROOT::Initialized()) {
90 }
91 return kTRUE;
92}
93
94//----- SigPipe signal handler -------------------------------------------------
95////////////////////////////////////////////////////////////////////////////////
96
99public:
101 { fServ = s; }
102 Bool_t Notify();
103};
104
105////////////////////////////////////////////////////////////////////////////////
106/// Handle sig pipe
107
109{
111 return kTRUE;
112}
113
114//----- Termination signal handler ---------------------------------------------
115////////////////////////////////////////////////////////////////////////////////
116
119public:
122 Bool_t Notify();
123};
124
125////////////////////////////////////////////////////////////////////////////////
126/// Handle termination
127
129{
130 Printf("TProofServLiteTerminationHandler::Notify: wake up!");
131
133 return kTRUE;
134}
135
136//----- Seg violation signal handler ---------------------------------------------
137////////////////////////////////////////////////////////////////////////////////
138
141public:
144 Bool_t Notify();
145};
146
147////////////////////////////////////////////////////////////////////////////////
148/// Handle seg violation
149
151{
152 Printf("**** ");
153 Printf("**** Segmentation violation: terminating ****");
154 Printf("**** ");
156 return kTRUE;
157}
158
159//----- Input handler for messages from parent or master -----------------------
160////////////////////////////////////////////////////////////////////////////////
161
164public:
166 { fServ = s; }
167 Bool_t Notify();
168 Bool_t ReadNotify() { return Notify(); }
169};
170
171////////////////////////////////////////////////////////////////////////////////
172/// Handle input on the socket
173
175{
177
178 return kTRUE;
179}
180
182
183// Hook to the constructor. This is needed to avoid using the plugin manager
184// which may create problems in multi-threaded environments.
185extern "C" {
186 TApplication *GetTProofServLite(Int_t *argc, char **argv, FILE *flog)
187 { return new TProofServLite(argc, argv, flog); }
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Main constructor
192
193TProofServLite::TProofServLite(Int_t *argc, char **argv, FILE *flog)
194 : TProofServ(argc, argv, flog)
195{
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Finalize the server setup. If master, create the TProof instance to talk
202/// the worker or submaster nodes.
203/// Return 0 on success, -1 on error
204
206{
207 if (gProofDebugLevel > 0)
208 Info("CreateServer", "starting server creation");
209
210 // Get file descriptor for log file
211 if (fLogFile) {
212 // Use the file already open by pmain
213 if ((fLogFileDes = fileno(fLogFile)) < 0) {
214 Error("CreateServer", "resolving the log file description number");
215 return -1;
216 }
217 }
218
219 // Get socket to be used to call back our xpd
220 fSockPath = gEnv->GetValue("ProofServ.OpenSock", "");
221 if (fSockPath.Length() <= 0) {
222 Error("CreateServer", "Socket setup by xpd undefined");
223 return -1;
224 }
225 TString entity = gEnv->GetValue("ProofServ.Entity", "");
226 if (entity.Length() > 0)
227 fSockPath.Insert(0,TString::Format("%s/", entity.Data()));
228
229 // Call back the client
231 if (!fSocket || !(fSocket->IsValid())) {
232 Error("CreateServer", "Failed to open connection to the client");
233 return -1;
234 }
235
236 // Send our ordinal, to allow the client to identify us
237 TMessage msg;
238 msg << fOrdinal;
239 fSocket->Send(msg);
240
241 // Get socket descriptor
242 Int_t sock = fSocket->GetDescriptor();
243
244 // Install interrupt and message input handlers
248
249 // Wait (loop) in worker node to allow debugger to connect
250 if (gEnv->GetValue("Proof.GdbHook",0) == 2) {
251 while (gProofServDebug)
252 ;
253 }
254
255 if (gProofDebugLevel > 0)
256 Info("CreateServer", "Service: %s, ConfDir: %s, IsMaster: %d",
258
259 if (Setup() == -1) {
260 // Setup failure
261 Terminate(0);
262 SendLogFile();
263 return -1;
264 }
265
266 if (!fLogFile) {
268 // If for some reason we failed setting a redirection file for the logs
269 // we cannot continue
270 if (!fLogFile || (fLogFileDes = fileno(fLogFile)) < 0) {
271 Terminate(0);
272 SendLogFile(-98);
273 return -1;
274 }
275 }
276
277 // Everybody expects std::iostream to be available, so load it...
278 ProcessLine("#include <iostream>", kTRUE);
279 ProcessLine("#include <string>",kTRUE); // for std::string std::iostream.
280
281 // Load user functions
282 const char *logon;
283 logon = gEnv->GetValue("Proof.Load", (char *)0);
284 if (logon) {
285 char *mac = gSystem->Which(TROOT::GetMacroPath(), logon, kReadPermission);
286 if (mac)
287 ProcessLine(TString::Format(".L %s", logon), kTRUE);
288 delete [] mac;
289 }
290
291 // Execute logon macro
292 logon = gEnv->GetValue("Proof.Logon", (char *)0);
293 if (logon && !NoLogOpt()) {
294 char *mac = gSystem->Which(TROOT::GetMacroPath(), logon, kReadPermission);
295 if (mac)
296 ProcessFile(logon);
297 delete [] mac;
298 }
299
300 // Save current interpreter context
301 gInterpreter->SaveContext();
302 gInterpreter->SaveGlobalsContext();
303
304 // Avoid spurious messages at first action
305 FlushLogFile();
306
307 // Done
308 return 0;
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Cleanup. Not really necessary since after this dtor there is no
313/// live anyway.
314
316{
317 delete fSocket;
318}
319
320////////////////////////////////////////////////////////////////////////////////
321/// Called when the client is not alive anymore; terminate the session.
322
324{
325 Terminate(0); // will not return from here....
326}
327
328////////////////////////////////////////////////////////////////////////////////
329/// Called when the client is not alive anymore; terminate the session.
330
332{
333 Terminate(0); // will not return from here....
334}
335
336////////////////////////////////////////////////////////////////////////////////
337/// Print the ProofServ logo on standard output.
338/// Return 0 on success, -1 on error
339
341{
342 char str[512];
343
344 if (IsMaster()) {
345 snprintf(str, 512, "**** Welcome to the PROOF server @ %s ****", gSystem->HostName());
346 } else {
347 snprintf(str, 512, "**** PROOF worker server @ %s started ****", gSystem->HostName());
348 }
349
350 if (fSocket->Send(str) != 1+static_cast<Int_t>(strlen(str))) {
351 Error("Setup", "failed to send proof server startup message");
352 return -1;
353 }
354
355 // Get client protocol
356 if ((fProtocol = gEnv->GetValue("ProofServ.ClientVersion", -1)) < 0) {
357 Error("Setup", "remote proof protocol missing");
358 return -1;
359 }
360
361 // The local user
363 if (pw) {
364 fUser = pw->fUser;
365 delete pw;
366 }
367
368 // Work dir and ...
369 fWorkDir = gEnv->GetValue("ProofServ.Sandbox", TString::Format("~/%s", kPROOF_WorkDir));
370 Info("Setup", "fWorkDir: %s", fWorkDir.Data());
371
372 // Get Session tags
373 fTopSessionTag = gEnv->GetValue("ProofServ.SessionTag", "-1");
374 fSessionTag.Form("%s-%s-%ld-%d", fOrdinal.Data(), gSystem->HostName(),
375 (Long_t)TTimeStamp().GetSec(), gSystem->GetPid());
376 if (gProofDebugLevel > 0)
377 Info("Setup", "session tag is %s", fSessionTag.Data());
379
380 // Send session tag to client
382 m << fSessionTag;
383 fSocket->Send(m);
384
385 // Get Session dir (sandbox)
386 if ((fSessionDir = gEnv->GetValue("ProofServ.SessionDir", "-1")) == "-1") {
387 Error("Setup", "Session dir missing");
388 return -1;
389 }
390
391 // Link the session tag to the log file
392 if (gSystem->Getenv("ROOTPROOFLOGFILE")) {
393 TString logfile = gSystem->Getenv("ROOTPROOFLOGFILE");
394 Int_t iord = logfile.Index(TString::Format("-%s", fOrdinal.Data()));
395 if (iord != kNPOS) logfile.Remove(iord);
396 logfile += TString::Format("-%s.log", fSessionTag.Data());
397 gSystem->Symlink(gSystem->Getenv("ROOTPROOFLOGFILE"), logfile);
398 }
399
400 // Goto to the main PROOF working directory
402 if (gProofDebugLevel > 0)
403 Info("Setup", "working directory set to %s", fWorkDir.Data());
404
405 // Common setup
406 if (SetupCommon() != 0) {
407 Error("Setup", "common setup failed");
408 return -1;
409 }
410
411 // Check every two hours if client is still alive
413
414 // Install SigPipe handler to handle kKeepAlive failure
416
417 // Install Termination handler
419
420 // Install seg violation handler
422
423 // Done
424 return 0;
425}
426
427////////////////////////////////////////////////////////////////////////////////
428/// Terminate the proof server.
429
431{
432 if (fTerminated)
433 // Avoid doubling the exit operations
434 exit(1);
436
437 // Notify
438 Info("Terminate", "starting session termination operations ...");
439
440 // Cleanup session directory
441 if (status == 0) {
442 // make sure we remain in a "connected" directory
444 // needed in case fSessionDir is on NFS ?!
445 gSystem->MakeDirectory(fSessionDir+"/.delete");
447 }
448
449 // Cleanup data directory if empty
452 Info("Terminate", "data directory '%s' has been removed", fDataDir.Data());
453 }
454
455 // Remove input and signal handlers to avoid spurious "signals"
456 // for closing activities executed upon exit()
458
459 // Stop processing events (set a flag to exit the event loop)
460 gSystem->ExitLoop();
461
462 // Notify
463 Printf("Terminate: termination operations ended: quitting!");
464}
465
466////////////////////////////////////////////////////////////////////////////////
467/// Cloning itself via fork.
468
470{
471 if (!mess) {
472 Error("HandleFork", "empty message!");
473 return;
474 }
475
476 // Extract the ordinals of the clones
477 TString clones;
478 (*mess) >> clones;
479 PDB(kGlobal, 1)
480 Info("HandleFork", "cloning to %s", clones.Data());
481
482 TString clone;
483 Int_t from = 0;
484 while (clones.Tokenize(clone, from, " ")) {
485
486 Int_t rc = 0;
487 // Fork
488 if ((rc = Fork()) < 0) {
489 Error("HandleFork", "failed to fork %s", clone.Data());
490 return;
491 }
492
493 // If the child, finalize the setup and return
494 if (rc == 0) {
495 SetupOnFork(clone.Data());
496 return;
497 }
498 }
499
500 // Done
501 return;
502}
503
504////////////////////////////////////////////////////////////////////////////////
505/// Finalize the server setup afetr forking.
506/// Return 0 on success, -1 on error
507
509{
510 if (gProofDebugLevel > 0)
511 Info("SetupOnFork", "finalizing setup of %s", ord);
512
513 // Set the ordinal
514 fOrdinal = ord;
515 TString sord;
516 sord.Form("-%s", fOrdinal.Data());
517
518 // Close the current log file
519 if (fLogFile) {
520 fclose(fLogFile);
521 fLogFileDes = -1;
522 }
523
525 RedirectOutput(sdir.Data(), "a");
526 // If for some reason we failed setting a redirection file for the logs
527 // we cannot continue
528 if (!fLogFile || (fLogFileDes = fileno(fLogFile)) < 0) {
529 Terminate(0);
530 return -1;
531 }
532 FlushLogFile();
533
534 // Eliminate existing symlink
535 void *dirp = gSystem->OpenDirectory(sdir);
536 if (dirp) {
537 TString ent;
538 const char *e = 0;
539 while ((e = gSystem->GetDirEntry(dirp))) {
540 ent.Form("%s/%s", sdir.Data(), e);
541 FileStat_t st;
542 if (gSystem->GetPathInfo(ent.Data(), st) == 0) {
543 if (st.fIsLink && ent.Contains(sord)) {
544 PDB(kGlobal, 1)
545 Info("SetupOnFork","unlinking: %s", ent.Data());
546 gSystem->Unlink(ent);
547 }
548 }
549 }
550 gSystem->FreeDirectory(dirp);
551 }
552
553 // The session tag
554 fSessionTag.Form("%s-%d-%d", gSystem->HostName(), (int)time(0), gSystem->GetPid());
555
556 // Create new symlink
557 TString logfile = gSystem->Getenv("ROOTPROOFLOGFILE");
558 logfile.ReplaceAll("-0.0", sord.Data());
559 gSystem->Setenv("ROOTPROOFLOGFILE", logfile);
560 Int_t iord = logfile.Index(sord.Data());
561 if (iord != kNPOS) logfile.Remove(iord + sord.Length());
562 logfile += TString::Format("-%s.log", fSessionTag.Data());
563 gSystem->Symlink(gSystem->Getenv("ROOTPROOFLOGFILE"), logfile);
564
565 // Get socket to be used to call back our xpd
566 fSockPath = gEnv->GetValue("ProofServ.OpenSock", "");
567 if (fSockPath.Length() <= 0) {
568 Error("CreateServer", "Socket setup by xpd undefined");
569 return -1;
570 }
571 TString entity = gEnv->GetValue("ProofServ.Entity", "");
572 if (entity.Length() > 0)
573 fSockPath.Insert(0, TString::Format("%s/", entity.Data()));
574
575 // Call back the client
577 if (!fSocket || !(fSocket->IsValid())) {
578 Error("CreateServer", "Failed to open connection to the client");
579 return -1;
580 }
581
582 // Send our ordinal, to allow the client to identify us
583 TMessage msg;
584 msg << fOrdinal;
585 fSocket->Send(msg);
586
587 // Get socket descriptor
588 Int_t sock = fSocket->GetDescriptor();
589
590 // Install interrupt and message input handlers
594
595 // Wait (loop) in worker node to allow debugger to connect
596 if (gEnv->GetValue("Proof.GdbHook",0) == 2) {
597 while (gProofServDebug)
598 ;
599 }
600
601 if (gProofDebugLevel > 0)
602 Info("SetupOnFork", "Service: %s, ConfDir: %s, IsMaster: %d",
604
605 if (Setup() == -1) {
606 // Setup failure
607 Terminate(0);
608 SendLogFile();
609 return -1;
610 }
611
612 // Disallow the interpretation of Rtypes.h, TError.h and TGenericClassInfo.h
613 ProcessLine("#define ROOT_Rtypes 0", kTRUE);
614 ProcessLine("#define ROOT_TError 0", kTRUE);
615 ProcessLine("#define ROOT_TGenericClassInfo 0", kTRUE);
616
617 // Save current interpreter context
618 gInterpreter->SaveContext();
619 gInterpreter->SaveGlobalsContext();
620
621 // Done
622 return 0;
623}
@ kPROOF_SESSIONTAG
Definition: MessageTypes.h:79
#define e(i)
Definition: RSha256.hxx:103
bool Bool_t
Definition: RtypesCore.h:63
const Ssiz_t kNPOS
Definition: RtypesCore.h:124
int Int_t
Definition: RtypesCore.h:45
const Bool_t kFALSE
Definition: RtypesCore.h:101
long Long_t
Definition: RtypesCore.h:54
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:375
R__EXTERN TEnv * gEnv
Definition: TEnv.h:170
R__EXTERN void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set.
Definition: TException.cxx:27
#define gInterpreter
Definition: TInterpreter.h:564
#define PDB(mask, level)
Definition: TProofDebug.h:56
R__EXTERN Int_t gProofDebugLevel
Definition: TProofDebug.h:54
static volatile Int_t gProofServDebug
TApplication * GetTProofServLite(Int_t *argc, char **argv, FILE *flog)
const char *const kRM
Definition: TProof.h:142
const char *const kPROOF_WorkDir
Definition: TProof.h:124
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition: TString.cxx:2461
@ kSigTermination
@ kSigPipe
@ kSigUrgent
@ kSigSegmentationViolation
@ kKeepAlive
Definition: TSystem.h:219
@ kReadPermission
Definition: TSystem.h:47
@ kWritePermission
Definition: TSystem.h:46
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
#define snprintf
Definition: civetweb.c:1540
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
Definition: TApplication.h:39
virtual Longptr_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=nullptr)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
virtual Longptr_t ProcessFile(const char *file, Int_t *error=nullptr, Bool_t keep=kFALSE)
Process a file containing a C++ macro.
Bool_t NoLogOpt() const
Definition: TApplication.h:138
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:867
Bool_t Notify()
Handle input on the socket.
TProofServLiteInputHandler(TProofServLite *s, Int_t fd)
Bool_t ReadNotify()
Notify when something can be read from the descriptor associated with this handler.
TProofServLiteInterruptHandler(TProofServLite *s)
Bool_t Notify()
Handle urgent data.
Bool_t Notify()
Handle seg violation.
TProofServLiteSegViolationHandler(TProofServLite *s)
TProofServLiteSigPipeHandler(TProofServLite *s)
Bool_t Notify()
Handle sig pipe.
Bool_t Notify()
Handle termination.
TProofServLiteTerminationHandler(TProofServLite *s)
Version of the PROOF worker server for local running.
Int_t CreateServer()
Finalize the server setup.
void HandleSigPipe()
Called when the client is not alive anymore; terminate the session.
TProofServLiteInterruptHandler * fInterruptHandler
Int_t SetupOnFork(const char *ord)
Finalize the server setup afetr forking.
void HandleFork(TMessage *mess)
Cloning itself via fork.
virtual ~TProofServLite()
Cleanup.
Int_t Setup()
Print the ProofServ logo on standard output.
void Terminate(Int_t status)
Terminate the proof server.
void HandleTermination()
Called when the client is not alive anymore; terminate the session.
Class providing the PROOF server.
Definition: TProofServ.h:66
Int_t fProtocol
Definition: TProofServ.h:103
FILE * fLogFile
Definition: TProofServ.h:100
TString fDataDir
Definition: TProofServ.h:90
TString fSessionDir
Definition: TProofServ.h:85
void FlushLogFile()
Reposition the read pointer in the log file to the very end.
TString fService
Definition: TProofServ.h:76
Int_t fLogFileDes
Definition: TProofServ.h:101
void RedirectOutput(const char *dir=0, const char *mode="w")
Redirect stdout to a log file.
Bool_t fMasterServ
Definition: TProofServ.h:111
virtual void HandleUrgentData()
Handle Out-Of-Band data sent by the master or client.
TSocket * fSocket
Definition: TProofServ.h:97
Int_t SetupCommon()
Common part (between TProofServ and TXProofServ) of the setup phase.
virtual Int_t HandleSocketInput(TMessage *mess, Bool_t all)
Process input coming from the client or from the master server.
TString fSessionTag
Definition: TProofServ.h:83
Bool_t IsMaster() const
Definition: TProofServ.h:293
TString fOrdinal
Definition: TProofServ.h:104
TString fWorkDir
Definition: TProofServ.h:81
TString fTopSessionTag
Definition: TProofServ.h:84
friend class TProofServLite
Definition: TProofServ.h:68
TString fConfDir
Definition: TProofServ.h:79
virtual Int_t Fork()
Fork a child.
Bool_t UnlinkDataDir(const char *path)
Scan recursively the datadir and unlink it if empty Return kTRUE if it can be unlinked,...
TString fUser
Definition: TProofServ.h:77
virtual void SendLogFile(Int_t status=0, Int_t start=-1, Int_t end=-1)
Send log file to master.
static const char * GetMacroPath()
Get macro search path. Static utility function.
Definition: TROOT.cxx:2708
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
Definition: TROOT.cxx:2822
ESignals GetSignal() const
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
Definition: TSocket.cxx:1013
virtual Int_t GetDescriptor() const
Definition: TSocket.h:112
virtual Bool_t IsValid() const
Definition: TSocket.h:132
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
Definition: TSocket.cxx:522
Basic string class.
Definition: TString.h:136
Ssiz_t Length() const
Definition: TString.h:410
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:649
const char * Data() const
Definition: TString.h:369
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2222
Bool_t IsNull() const
Definition: TString.h:407
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2336
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2314
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
Definition: TSystem.cxx:557
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
Definition: TSystem.cxx:1368
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1274
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition: TSystem.cxx:846
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TSystem.cxx:837
virtual int GetPid()
Get process id.
Definition: TSystem.cxx:710
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1663
virtual int MakeDirectory(const char *name)
Make a directory.
Definition: TSystem.cxx:828
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:656
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:1398
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:1296
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TSystem.cxx:854
virtual void ExitLoop()
Exit from event loop.
Definition: TSystem.cxx:395
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:863
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
Definition: TSystem.cxx:535
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:306
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition: TSystem.cxx:1546
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
Definition: TSystem.cxx:545
virtual void Setenv(const char *name, const char *value)
Set environment variable.
Definition: TSystem.cxx:1647
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1032
virtual int Unlink(const char *name)
Unlink, i.e.
Definition: TSystem.cxx:1381
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition: TSystem.cxx:1599
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:71
static constexpr double s
Bool_t fIsLink
Definition: TSystem.h:132
TString fUser
Definition: TSystem.h:141
TMarker m
Definition: textangle.C:8