13 #ifndef ROOT_TWinNTSystem
14 #define ROOT_TWinNTSystem
29 #if !defined(__CINT__)
34 struct WIN32_FIND_DATA;
35 typedef void* HIMAGELIST;
42 #define MAX_SID_SIZE 1024
44 #define MAX_NAME_STRING 1024
152 int Exec(
const char *shellcmd);
153 FILE *
OpenPipe(
const char *shellcmd,
const char *mode);
156 void Abort(
int code = 0);
168 const char *
DirName(
const char *pathname);
188 const char DriveName(
const char *pathname=
"/");
196 int Rename(
const char *from,
const char *to);
197 int Link(
const char *from,
const char *to);
198 int Symlink(
const char *from,
const char *to);
221 const char *option =
"",
233 int ConnectService(
const char *servername,
int port,
int tcpwindowsize,
const char *protocol =
"tcp");
239 int OpenConnection(
const char *server,
int port,
int tcpwindowsize = -1,
const char *protocol =
"tcp");
Int_t GetGid(const char *group=0)
Returns the group's id. If group = 0, returns current user's group.
void DispatchOneEvent(Bool_t pendingOnly=kFALSE)
Dispatch a single event in TApplication::Run() loop.
const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
int GetSockOpt(int sock, int opt, int *val)
Get socket option.
FILE * OpenPipe(const char *shellcmd, const char *mode)
Open a pipe.
Int_t GetEffectiveGid()
Returns the effective group id.
UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
int RecvRaw(int sock, void *buffer, int length, int flag)
Receive exactly length bytes into buffer.
const char * HostName()
Return the system's host name.
WIN32_FIND_DATA fFindFileData
void SetDynamicPath(const char *path)
Set the dynamic path to a new value.
int Link(const char *from, const char *to)
Create a link from file1 to file2.
const char * GetError()
Return system error string.
void * GetGUIThreadHandle() const
const char * GetLinkedLibraries()
Get list of shared libraries loaded at the start of the executable.
int Unlink(const char *name)
Unlink, i.e. remove, a file or directory.
HANDLE GetProcess()
Get current process handle.
void DoBeep(Int_t freq=-1, Int_t duration=-1) const
Beep.
TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
void CloseConnection(int sock, Bool_t force=kFALSE)
Close socket.
int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
void AddDynamicPath(const char *dir)
Add a new directory to the dynamic path.
TTimer * RemoveTimer(TTimer *ti)
Remove timer from list of system timers.
This class represents an Internet Protocol (IP) address.
int GetPathInfo(const char *path, FileStat_t &buf)
Get info about a file.
Int_t GetSysInfo(SysInfo_t *info) const
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
int Umask(Int_t mask)
Set the process file creation mode mask.
char * GetServiceByPort(int port)
Get name of internet service.
int SendRaw(int sock, const void *buffer, int length, int flag)
Send exactly length bytes from buffer.
Int_t GetMemInfo(MemInfo_t *info) const
Returns ram and swap memory usage info into the MemInfo_t structure.
void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE)
If ignore is true ignore the specified signal, else restore previous behaviour.
Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
Bool_t CheckDescriptors()
Check if there is activity on some file descriptors and call their Notify() member.
const char * DirName(const char *pathname)
Return the directory name in pathname.
static void ThreadStub(void *Parameter)
Basic time type with millisecond precision.
int ClosePipe(FILE *pipe)
Close the pipe.
Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
Int_t GetEffectiveUid()
Returns the effective user id.
void NotifyApplicationCreated()
Hook to tell TSystem that the TApplication object has been created.
Bool_t DispatchTimers(Bool_t mode)
Handle and dispatch timers.
Int_t GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const
Returns cpu load average and load info into the CpuInfo_t structure.
void Abort(int code=0)
Abort the application.
void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
Bool_t ChangeDirectory(const char *path)
Change directory.
static int WinNTUnixConnect(int port)
Connect to a Unix domain socket.
#define ClassDef(name, id)
TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
Int_t GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
Int_t SetFPEMask(Int_t mask=kDefaultMask)
Set which conditions trigger a floating point exception.
int AcceptConnection(int sock)
Accept a connection.
const char * FindDynamicLibrary(TString &lib, Bool_t quiet=kFALSE)
Returns and updates sLib to the path of a dynamic library (searches for library in the dynamic librar...
int GetPid()
Get process id.
void AddTimer(TTimer *ti)
Add timer to list of system timers.
const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
R__EXTERN ULong_t gConsoleWindow
const char * WorkingDirectory()
Return the working directory for the default drive.
int GetServiceByName(const char *service)
Get port # of internet service.
int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp")
Open a connection to a service on a server.
const char * GetDynamicPath()
Return the dynamic path (used to find shared libraries).
Bool_t InitUsersGroups()
Collect local users and groups accounts information.
virtual ~TWinNTSystem()
dtor
int MakeDirectory(const char *name)
Make a WinNT file system directory.
const char * GetDirEntry(void *dirp)
Returns the next directory entry.
static int WinNTUdpConnect(const char *hostname, int port)
Creates a UDP socket connection Is called via the TSocket constructor.
Bool_t Init()
Initialize WinNT system interface.
void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
const char * BaseName(const char *name)
Base name of a file name.
Bool_t ProcessEvents()
process pending events, i.e. DispatchOneEvent(kTRUE)
Double_t length(const TVector2 &v)
Int_t GetFPEMask()
Return the bitmap of conditions that trigger a floating point exception.
int ConnectService(const char *servername, int port, int tcpwindowsize, const char *protocol="tcp")
Connect to service servicename on server servername.
void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
int Utime(const char *file, Long_t modtime, Long_t actime)
Set a files modification and access times.
void ResetSignal(ESignals sig, Bool_t reset=kTRUE)
If reset is true reset the signal handler for the specified signal to the default handler...
struct passwd * fPasswords
const char * UnixPathName(const char *unixpathname)
Convert a pathname to a unix pathname.
Handles synchronous and a-synchronous timer events.
void ResetSignals()
Reset signals handlers to previous behaviour.
void DispatchSignals(ESignals sig)
Handle and dispatch signals.
const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
const char DriveName(const char *pathname="/")
Return the drive letter in pathname.
void ExitLoop()
Exit from event loop.
int Exec(const char *shellcmd)
Execute a command.
UserGroup_t * GetGroupInfo(Int_t gid)
Returns all group info in the UserGroup_t structure.
int SendBuf(int sock, const void *buffer, int length)
Send a buffer headed by a length indicator.
int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize=-1)
Announce TCP/IP service.
int AnnounceUnixService(int port, int backlog)
Announce unix domain service.
int RecvBuf(int sock, void *buffer, int length)
Receive a buffer headed by a length indicator.
int Chmod(const char *file, UInt_t mode)
Set the file permission bits.
double func(double *x, double *p)
int AnnounceUdpService(int port, int backlog)
Announce UDP service.
void TimerThread()
Special Thread to check asynchronous timers.
Bool_t HandleConsoleEvent()
int Symlink(const char *from, const char *to)
Create a symlink from file1 to file2.
void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
TInetAddress GetPeerName(int sock)
Get Internet Protocol (IP) address of remote host and port #.
TFileHandler * RemoveFileHandler(TFileHandler *fh)
Remove a file handler from the list of file handlers.
Bool_t ExpandPathName(TString &patbuf)
Expand a pathname getting rid of special shell characaters like ~.$, etc.
void FreeDirectory(void *dirp)
Close a WinNT file system directory.
Int_t Select(TList *active, Long_t timeout)
Select on file descriptors. The timeout to is in millisec.
int SetSockOpt(int sock, int opt, int val)
Set socket option.
TInetAddress GetSockName(int sock)
Get Internet Protocol (IP) address of host and port #.
Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
Bool_t CountMembers(const char *lpszGroupName)
Int_t GetUid(const char *user=0)
Returns the user's id. If user = 0, returns current user's id.
int SetNonBlock(int fd)
Make descriptor fd non-blocking.
int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: id, bsize, bfree, blocks.
FILE * TempFileName(TString &base, const char *dir=0)
Create a secure temporary file by appending a unique 6 letter string to base.
Long_t LookupSID(const char *lpszAccountName, int what, int &groupIdx, int &memberIdx)
Take the name and look up a SID so that we can get full domain/user information.
Bool_t(* ThreadMsgFunc_t)(MSG *)
Bool_t CollectMembers(const char *lpszGroupName, int &groupIdx, int &memberIdx)
void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
Bool_t CheckSignals(Bool_t sync)
Check if some signals were raised and call their Notify() member.
void Setenv(const char *name, const char *value)
Set environment variable.
Abstract base class defining a generic interface to the underlying Operating System.
void StackTrace()
Print a stack trace, if gEnv entry "Root.Stacktrace" is unset or 1, and if the image helper functions...
ULong_t GetGUIThreadId() const
TList * GetVolumes(Option_t *opt="") const
Get list of volumes (drives) mounted on the system.
const char * Getenv(const char *name)
Get environment variable.
void SetGUIThreadMsgHandler(ThreadMsgFunc_t func)
Set the (static part of) the event handler func for GUI messages.
Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
int Rename(const char *from, const char *to)
Rename a file. Returns 0 when successful, -1 in case of failure.