KListOpenFilesJob Class

Provides information about processes that have open files in a given path or subdirectory of path. More...

Header: #include <KListOpenFilesJob>
CMake: find_package(KF6 REQUIRED COMPONENTS CoreAddons)
target_link_libraries(mytarget PRIVATE KF6::CoreAddons)
Since: 5.63
Inherits: KJob

Public Types

enum class Error { NotSupported, InternalError, DoesNotExist }

Public Functions

KProcessList::KProcessInfoList processInfoList() const

Detailed Description

When start() is invoked it starts to collect information about processes that have any files open in path or a subdirectory of path. When it is done the KJob::result signal is emitted and the result can be retrieved with the processInfoList function.

On Unix like systems the lsof utility is used to get the list of processes. On Windows the listing always fails with error code NotSupported.

Member Type Documentation

enum class KListOpenFilesJob::Error

Special error codes emitted by KListOpenFilesJob

The KListOpenFilesJob uses the error codes defined here besides the standard error codes defined by KJob

ConstantValueDescription
KListOpenFilesJob::Error::NotSupportedKJob::UserDefinedError + 1Indicates that the platform doesn't support listing open files by processes
KListOpenFilesJob::Error::InternalErrorKJob::UserDefinedError + 2Internal error has ocurred
KListOpenFilesJob::Error::DoesNotExistKJob::UserDefinedError + 11The specified path does not exist

Member Function Documentation

KProcessList::KProcessInfoList KListOpenFilesJob::processInfoList() const

Returns the list of processes with open files for the requested path

Returns The list of processes with open files for the requested path