As some people at GUADEC asked me to continue the technical stories about Tinymail, here’s a preview on how it goes:
When you open a local E-mail folder that is stored on a MMC card, you obviously need to open some resources. Those include, for example, the summary’s mmapable file. You might also need to opendir() the directory and perhaps even chdir() to it? Perhaps rename items from a “new” or “tmp” to a “cur” subdirectory? In the process you might have left a directory or two open?
Suddenly … you get bug reports from system testers telling you that if the E-mail client is running, they can’t unmount the MMC card.
Today, Tinymail’s implementation for a few local E-mail folders makes sure that no directory related resources are left open, chdir() always goes to the root folder and the mapped files are closed as soon as the last component stopped using the folder.