nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Slowdown with a Populated Folder.

2014-01-01 09:34:33
Hi Ken,

`mark -s foo -d all' gives an error if sequence foo doesn't exist,
at least with this old version.  Consequently, another mark is
needed first, the one above, to detect if the sequence exists.  A
more useful interface would cut the number of userspace commands
that need to run, and thus the number of getdents.

It looks like "mark -s foo -zero -d all" does what you want?

Yes, that's handy, thanks.  ~/bin/mhseqrm altered to use it.
http://git.savannah.gnu.org/cgit/nmh.git/tree/man/mark.man#n95 covers
the case where a sequence exists;  perhaps this could be added there.

Looking at some of the others uses of ~/bin/mhseqexists, I find

    mhseqexists lp && mark -seq lpsave -zero -add lp
    # ...
    if mhseqexists lpsave; then
        mark -seq lp -zero -add lpsave
        mhseqrm lpsave
    fi

It would be nice if that could be

    mark -newswitch -seq lpsave -zero -add lp
    # ...
    mark -newswitch -seq lp -zero -add lpsave

where an unknown sequence being added is treated as empty.  We already
have, as you've shown, the ability to "create" an empty sequence that
doesn't get saved.

    todelete=$(
        for seq in foo bar xyzzy; do
            mhseqexists $seq && echo $seq
        done
    )
    test "$todelete" && mark -seq i -delete $todelete

Again, unknown sequences being empty would give

    mark -newswitch -seq i -delete foo bar xyzzy

Cheers, Ralph.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

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