lsof

package
v0.0.0-...-786bce8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package lsof provides a way to list open files for a given process

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is returned when the function is not implemented

Functions

This section is empty.

Types

type File

type File struct {
	Fd       string
	Type     string
	OpenPerm string
	FilePerm string
	Size     int64
	Name     string
}

File represents an open file The fields are not guaranteed to match lsof output, but they are good enough for debugging

type Files

type Files []File

Files represents a list of open files

func ListOpenFiles

func ListOpenFiles(pid int) (Files, error)

ListOpenFiles returns a list of open files for the given process

func ListOpenFilesFromSelf

func ListOpenFilesFromSelf() (Files, error)

ListOpenFilesFromSelf returns a list of open files for the current process

func (Files) String

func (files Files) String() string

Jump to

Keyboard shortcuts

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