Closed al-online closed 2 months ago
I have confirmed that it works on my Windows machine, and it seems to be functioning correctly. Thank you.
However, file descriptors (FD) on Unix-like systems and handles on Windows are not exactly the same. Because of this, psutil provides a separate function called num_handles().
It would be possible for gopsutil to prepare a platform-specific struct like ExWindows, but that would add complexity.
The differences between FDs and handles are not that significant, so it seems like we just need to be mindful of how they are used. Therefore, how about adding a comment like, "On Windows, this returns the number of handles, not number of FDs" on the NumFDsWithContext
in process_windows.go?
Sure, this clarification is indeed necessary, and I am willing to add the comment!
I found that gopsutil does not have a method to get the number of handles for a process, so I implemented it myself and would like to submit a pull request.