KIO

kioglobal_p_unix.cpp
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2014 Alex Richardson <arichardson.kde@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.0-only
6*/
7#include "kioglobal_p.h"
8
9#include <QFile>
10#include <signal.h>
11#include <unistd.h>
12
13KIOCORE_EXPORT bool KIOPrivate::isProcessAlive(qint64 pid)
14{
15 return ::kill(pid, 0) == 0;
16}
17
18KIOCORE_EXPORT void KIOPrivate::sendTerminateSignal(qint64 pid)
19{
20 ::kill(pid, SIGTERM);
21}
22
23KIOCORE_EXPORT bool KIOPrivate::createSymlink(const QString &source, const QString &destination, SymlinkType type)
24{
25 Q_UNUSED(type)
26 return ::symlink(QFile::encodeName(source).constData(), QFile::encodeName(destination).constData()) == 0;
27}
28
29KIOCORE_EXPORT bool KIOPrivate::changeOwnership(const QString &file, KUserId newOwner, KGroupId newGroup)
30{
31 return ::chown(QFile::encodeName(file).constData(), newOwner.nativeId(), newGroup.nativeId()) == 0;
32}
QByteArray encodeName(const QString &fileName)
NativeType nativeId() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.