On 8 Mar 2003, Timo Sirainen wrote: >On Sat, 2003-03-08 at 19:47, Andreas Aardal Hanssen wrote: >specific lock file that no others use? That isn't very interoperable.
The locks that one IMAP server uses should be of no interest for clients that are not of the same IMAP server. >That is anyway what I meant with the 2. above. If file is renamed while >you're scanning the directory, you may not see it at all and think it's >deleted. Next scan will find it again and show it as new mail. (...) >I don't know how readdir() usually works, but if rename()d file shows at >least once with new name, old name or both you can deal with that: Both >-> you see a conflict, you try to fix it and see that the other file >doesn't exist anymore. Old -> open() fails later and you rescan the >directory to find the new name. >But sure, as long as IMAP server locks the Maildir it can work fine as >long as other MUAs aren't modifying the message flags. Even then it's >very difficult to hit the condition when file isn't seen with readdir(). If renaming a file when a readdir is in progress causes that file (inode) to be skipped, then the OS is IMO broken! ;) readdir just scans through the list of files in a directory. The name of the file when it is stored in the same path is simply metadata, and will from all I understand not change its location (or existance) in the file list. I don't have any other experience here than what I have with ext2, but I guess others on this list can enrichen this context. Andy -- Andreas Aardal Hanssen
