Skip to content

Commit

Permalink
Update files_windows.go
Browse files Browse the repository at this point in the history
  • Loading branch information
MayCXC authored Oct 9, 2024
1 parent 3b1abc8 commit 7fd1a0c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions activation/files_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,22 @@ import "os"
func Files(unsetEnv bool) []*os.File {
return nil
}

// FilesWithNames maps fd names to a set of os.File pointers.
func FilesWithNames() map[string][]*os.File {
files := activation.Files(true)
filesWithNames := map[string][]*os.File{}

for _, f := range files {
current, ok := filesWithNames[f.Name()]

if !ok {
current = []*os.File{}
filesWithNames[f.Name()] = current
}

filesWithNames[f.Name()] = append(current, f)
}

return filesWithNames
}

0 comments on commit 7fd1a0c

Please sign in to comment.