()
| 289 | } |
| 290 | |
| 291 | func (p Proc) fileDescriptors() ([]string, error) { |
| 292 | d, err := os.Open(p.path("fd")) |
| 293 | if err != nil { |
| 294 | return nil, err |
| 295 | } |
| 296 | defer d.Close() |
| 297 | |
| 298 | names, err := d.Readdirnames(-1) |
| 299 | if err != nil { |
| 300 | return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err) |
| 301 | } |
| 302 | |
| 303 | return names, nil |
| 304 | } |
| 305 | |
| 306 | func (p Proc) path(pa ...string) string { |
| 307 | return p.fs.proc.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...) |
no test coverage detected