10#include "KVLockfile.h"
62 Warning(KV__ERROR(
init),
"Unix 'lockfile' command not found on system. You should install it.");
79 TString spath(path), backup(exec), backup2(exec), expandexec(exec);
104 if (!backup.EndsWith(
".exe")) {
126 cmd.
Form(
"%s -%d -r%d -l%d -s%d %s.lock",
135 cmd.
Form(
"%s -%d -r%d -s%d %s.lock",
172 cout <<
"<Error in KVLockfile::Lock: file " <<
fFile.
Data() <<
" is already locked. Release it first>" << endl;
183 cout <<
"<Error in KVLockfile::Lock: can't get a lock for file " <<
fFile.
Data() <<
">" << endl;
202 cout <<
"<Error in KVLockfile::Release: file is not locked. Lock it first>" << endl;
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 filename
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Interface to (Linux) system lockfile command.
Bool_t FindExecutable(TString &exec, const Char_t *path="$(PATH)")
copied from KVBase to avoid circular dependency
int locktimeout
time after which lock automatically opens
int retries
number of times to retry
KVString fFile
name of file
bool locked
kTRUE when Lock() has been called successfully
int sleeptime
time to wait before retrying lock
void writecmd()
Writes lockfile command with current values of parameters.
int suspend
suspend time after timeout
KVString fLockfile
full path to lockfile executable (if defined)
Bool_t Lock(const Char_t *filename="")
KVString cmd
command to execute
bool have_exec
kTRUE if lockfile found on system
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
const char * Data() const
void Form(const char *fmt,...)
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
virtual Int_t Exec(const char *shellcmd)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
virtual Bool_t IsAbsoluteFileName(const char *dir)
virtual char * ExpandPathName(const char *path)
virtual int Unlink(const char *name)