Skip to content

Commit

Permalink
Add doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Aug 28, 2023
1 parent 6216756 commit 99df9c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/file/is_opened.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/buildkite/agent/v3/internal/job/shell"
)

// IsOpened returns true if the file at the given path is opened by the current process.
func IsOpened(l shell.Logger, debug bool, path string) (bool, error) {
fdEntries, err := os.ReadDir("/dev/fd")
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions internal/file/opened_by.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var (
numeric = regexp.MustCompile("^[0-9]+$")
)

// OpenedBy attempts to find the executable that opened the given file.
func OpenedBy(l shell.Logger, debug bool, path string) (string, error) {
pidEntries, err := os.ReadDir("/proc")
if err != nil {
Expand Down

0 comments on commit 99df9c1

Please sign in to comment.