February 2019
Intermediate to advanced
672 pages
16h 50m
English
In real-life applications, it is rather easy to mismanage opened files in your programs by forgetting to close them; it can sometimes also be the case that it is impossible to tell whether the program has finished processing a file, and we programmers will therefore be unable to make a decision as to when to put the statement to close the files appropriately. This situation is even more common in concurrent and parallel programming, where the order of execution between different elements changes frequently.
One possible solution to this problem that is also common in other programming languages is to use a try...except...finally block every time we want to interact with an external file. This solution ...