Simple question: Not closing a file


#1

What kind of “doom” will happen is I don’t use .close()?


#2

This depends, Cpython will close the file while Jpython will not, so you can’t rely on python to close the file. So then the file stick around in memory (RAM). Which can become very problematic if you have to open many or larger files, you don’t give the memory back to the operating system.


#3

If I had been patient I would have had my question answered in 6/9. But it didn’t mention anything about Cpython and Jpython. Thanks!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.