43 if (locked) Release();
60 have_exec = FindExecutable(fLockfile);
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;
175 if (strcmp(filename,
"")) fFile = filename;
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;
Defines macros for standard error messages.
#define KV__ERROR(method)
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
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
void writecmd()
Writes lockfile command with current values of parameters.
Bool_t Lock(const Char_t *filename="")
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
const char * Data() const
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)