Is there a need to close file descriptors before exit?

前端 未结 1 1654
时光说笑
时光说笑 2021-02-12 06:27

Of course, the immediate answer for most situations is \"yes\", and I am a firm believer that a process should correctly cleanup any resources it has allocated,

相关标签:
1条回答
  • 2021-02-12 06:33

    Closing file descriptors when you are done using them makes your code more reusable and easier to extend. This sounds to me like a case where you have a valid reason for letting them get closed automatically.

    0 讨论(0)
提交回复
热议问题