diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-26 10:37:40 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-26 10:37:40 +0200 |
| commit | 4302cbf28a9d9efd2416ab6ea95168f9e39c29ec (patch) | |
| tree | 90e4dfb2f9cc71e483396c3465859d1282282348 /internal/file | |
| parent | c661b23f2940e07a1e1cbe16334598d999096f27 (diff) | |
tui: add fd trace drilldown and fd column in stream
Diffstat (limited to 'internal/file')
| -rw-r--r-- | internal/file/file.go | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/internal/file/file.go b/internal/file/file.go index ff8dae2..e8c818f 100644 --- a/internal/file/file.go +++ b/internal/file/file.go @@ -14,6 +14,7 @@ type File interface { String() string Name() string Flags() Flags + FD() int32 } type FdFile struct { @@ -24,15 +25,15 @@ type FdFile struct { } func NewFd(fd int32, name string, flags int32) FdFile { - f := FdFile{ - fd: fd, - name: name, - flags: Flags(flags), - } - if f.flags == -1 { - f.flags = unknownFlag - } - return f + f := FdFile{ + fd: fd, + name: name, + flags: Flags(flags), + } + if f.flags == -1 { + f.flags = unknownFlag + } + return f } func NewFdWithPid(fd int32, pid uint32) (f FdFile) { @@ -99,6 +100,10 @@ func (f FdFile) Flags() Flags { return f.flags } +func (f FdFile) FD() int32 { + return f.fd +} + func (f *FdFile) SetFlags(flags int32) { f.flags = Flags(flags) } @@ -123,6 +128,10 @@ func (f oldnameNewnameFile) Flags() Flags { return unknownFlag } +func (f oldnameNewnameFile) FD() int32 { + return -1 +} + func (f oldnameNewnameFile) String() string { var sb strings.Builder @@ -153,6 +162,10 @@ func (f pathnameFile) Flags() Flags { return unknownFlag } +func (f pathnameFile) FD() int32 { + return -1 +} + func (f pathnameFile) String() string { var sb strings.Builder |
