nmh-workers
[Top] [All Lists]

Scanning an Empty Folder Doesn't Change Current Folder.

2002-11-23 12:32:51

Hi,

After many years of MH use, I recently did

    $ folders +inbox
        # inbox/foo showed up in the list
    $ scan @foo
    scan: no messages in inbox/foo
    $ rmf @.    # since I don't want the empty folder no more.

I soon realised what I'd done from the messages telling me that
+inbox/bar wasn't empty, etc.  But I still lost all my 80-odd mail
messages in +inbox.  There weren't even any ,* files since rmf doesn't
leave those behind.

I'd argue that scan should still change the current folder even if the
destination is empty.  Does anyone know the reasoning behind the current
design?

Also, I can understand why rmf must *really* remove the files since its
ultimate aim is to rmdir their parent directory.  But perhaps a
multiple-pass approach would be better where it would first remove the
mail messages by renaming to ,* then, if it looks and sees it can do the
rmdir sucessfully because there isn't other stuff in the directory,
unlink the ,* files before rmdiring the folder.

That way I'd have had some ,* files to recover easily from.
Alternatively, have rmf not do anything if it can tell it won't
ultimately succeed.

Good to see nmh activity's still happening.

Cheers,


Ralph.


<Prev in Thread] Current Thread [Next in Thread>