KDECore
klockfile_unix.cpp
Go to the documentation of this file.
57 // * lockfile-create, from the lockfile-progs package, uses the link() trick from lockFileWithLink
61 // Note about flock: don't unlink, it creates a race. http://world.std.com/~swmcd/steven/tech/flock.html
KLockFile(const QString &file, const KComponentData &componentName=KGlobal::mainComponent())
Definition: klockfile_unix.cpp:116
bool remove()
bool setPermissions(QFlags< QFile::Permission > permissions)
static bool operator==(const KDE_struct_stat &st_buf1, const KDE_struct_stat &st_buf2)
Definition: klockfile_unix.cpp:141
Automatically remove a lock when a lock is detected that is stale for more than staleTime() seconds...
Definition: klockfile.h:84
A QTemporaryFile that will save in the KDE temp directory.
Definition: ktemporaryfile.h:92
LockResult lock(LockFlags flags=LockFlags())
Attempt to acquire the lock.
Definition: klockfile_unix.cpp:386
int staleTime() const
Return the time in seconds after which a lock is considered stale The default is 30.
Definition: klockfile_unix.cpp:129
The lock could not be acquired because it is held by another process.
Definition: klockfile.h:60
Type fileSystemType(const QString &path)
void clear()
bool getLockInfo(int &pid, QString &hostname, QString &appname)
Returns the pid, hostname and appname of the process holding the lock after the lock functon has retu...
Definition: klockfile_unix.cpp:502
void setStaleTime(int _staleTime)
Set the time in seconds after which a lock is considered stale.
Definition: klockfile_unix.cpp:136
QString number(int n, int base)
QString fromLocal8Bit(const char *str, int size)
const char * constData() const
void setFileTemplate(const QString &name)
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
#define FIELD_EQ(what)
static bool testLinkCountSupport(const QByteArray &fileName)
Definition: klockfile_unix.cpp:156
QString fileName() const
Definition: kfilesystemtype_p.h:30
char * data()
Return immediately, do not wait for the lock to become available.
Definition: klockfile.h:77
static bool operator!=(const KDE_struct_stat &st_buf1, const KDE_struct_stat &st_buf2)
Definition: klockfile_unix.cpp:150
bool open()
QByteArray encodeName(const QString &fileName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.