On Fri, Sep 04, 2009 at 01:15:58PM -0500, Kyle Wheeler wrote:
> On Friday, September 4 at 06:27 PM, quoth Chris G:
> >>>> - reading/writing/moving/deleting messages is faster than opening
> >>>> an mbox, looking for the right message, editing it, then
> >>>> rewriting the whole mbox.
> >>>>
> >>> Possibly faster for a *program* to do but not so easy for a
> >>> person to do directly.
>
> > I was referring to re-arrangement of mailboxes in particular, not
> > editing of message,
>
> ... perhaps I'm not understanding you, then. Why is 'mv' slower for
> Maildir than it is for mbox? On most Unix systems, it's the exact same
> operation (modify a dirent).
>
Except that as I described lower down many maildir hierarchies are not
actual directories.
> > anyway when does one want to edit messages, it's not something I've
> > ever wanted to do.
>
> Sometimes comes in handy if you're using email messages as notes to
> yourself or if you have a corrupt one you want to correct or if you
> want to test an email parsing tool you're writing... that sort of
> thing.
>
> >>> Depending on what/who created the maildir hierarchy you may
> >>> find it virtually impossible to move directories (which aren't
> >>> real directories) and mailboxes around.
> >>
> >> Why not?
> >>
> > Because *lots* of them create maildirs which aren't real directories
> > but use '.' as a delimiter. For example I have:-
> [snip]
> > Mail/holidays/2009/sarthe
> >
> > Where bikeRide and sarthe are the actual mailboxes (with others on the
> > other branches of course).
> >
> > Many maildir creators (most of the maildir+ ones I believe) in reality
> > create the above as:-
> [snip]
> > Mail.holidays.2009.sarthe
>
> I fail to see how this makes renaming or moving the sarthe mailbox
> "virtually impossible".
>
It makes it extremely awkward if you have some mailboxes at levels
part of the way down the hierarchy, it also make the names painfully
long.
> > So all the mailboxes are at the same level with names with embedded
> > dots, if you want to move mailboxes up and down the hierachy it is
> > rather difficult.
>
> Meh. First of all, if I'm using mutt, I can use whatever mail folder
> layout I want. Second, if I'm using the Maildir++ layout as described,
> it's usually because I'm using IMAP, which works the exact same way.
> Third, it's not that hard to rename multiple things with a little
> shell knowledge. For example:
>
> for F in Mail.holidays.2009.* ; do
> mv "$F" "${F/.2009/}"
> done
>
> But I suppose that all depends on your definition of "rather
> difficult".
>
> > I note you haven't questioned my comment that maildirs are difficult
> > to delete safely! :-)
>
> They're only difficult to delete "safely" if you're expecting them to
> get recreated at any moment. And that's only true if you need an
> algorithm that doesn't impose arbitrary naming restrictions. If you're
> allowed to do this:
>
> mv maildir ..maildir_deletemeXXXXXXXX
> rm -rf ..maildir_deletemeXXXXXXX
>
But those caveats apply in *exactly* the same way as your criteria for
maildir being 'safe' for access by multiple applications!
--
Chris Green