Help us shape the future of Go! Take the 2026 Go Developer Survey

lsof

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecError

type ExecError struct {
	// contains filtered or unexported fields
}

ExecError is an error running lsof

func (ExecError) Error

func (e ExecError) Error() string

type FileDescriptor

type FileDescriptor struct {
	FD   string
	Type FileType
	Name string
}

FileDescriptor defines a file in use by a process

func (FileDescriptor) String

func (f FileDescriptor) String() string

type FileType

type FileType string

FileType defines the type of file in use by a process

const (
	FileTypeUnknown FileType = ""
	FileTypeDir     FileType = "DIR"
	FileTypeFile    FileType = "REG"
)

type Process

type Process struct {
	PID             string
	Command         string
	UserID          string
	FileDescriptors []FileDescriptor
}

Process defines a process using an open file. Properties here are strings for compatibility with different platforms.

func MountPoint

func MountPoint(dir string) ([]Process, error)

MountPoint returns processes using the mountpoint "lsof /dir"

func (Process) String

func (p Process) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL