0

Just for curiosity...

In PHP we can get all opened in current process resources by using get_resources()

That was really helpful in one of my tasks when one of third-party libraries didn't close opened file properly and I used get_resources() to close file stream to be able delete file before process ends.

So, the question is:

Is here any way in python to get and close opened somewhere inside process resources (or streams) without knowing object or method where it was opened?

rzlvmp
  • 7,512
  • 5
  • 16
  • 45
  • 1
    To note: *resources* in PHP are a very specific thing and their own type, which is not really the case for Python. You're probably rather looking for UNIX-y tools to find all open ports/files/sockets. – deceze Aug 19 '21 at 06:12
  • Would this help: https://stackoverflow.com/questions/2023608/check-what-files-are-open-in-python – Roman Pavelka Aug 19 '21 at 08:08

0 Answers0