I think the question is What are you trying to fix with with dialog boxes? What are the use cases? Me, I want to save every change made to my todo list. There is never a case where I would make changes to the file, and then not want to save them. Therefore, I see no need for a confirmation on closing (just save the damn thing and exit) and also no need for a box on opening (just bring me back the last list I was working on).
On the other hand, if for some reason, the use case is that you make changes to a file, but then don't want to save them (often), then I can see the point for either of the confirmation boxes.
What I worry about here is that you're trying to code for a corner/boundary case that never, or rarely happens. (I find that I do that when I'm coding, often realizing later on that I've wasted precious time on a feature that will never be used, even by me.)
Hope this helps.