leahneukirchen / mblaze

Unix utilities to deal with Maildir
Other
441 stars 48 forks source link

mlist to list DT_LNK elements #172

Closed eiro closed 4 years ago

eiro commented 4 years ago

maildirs containing symlinks are good way to keep track of some mails, some indexers [1] can use this way to store the result of a query so you can use maildir tools to do whatever you want with the entries.

it would be convenient to use mblaze as well.

1: at least

leahneukirchen commented 4 years ago

Note that mu find --fields l will just output the file name, then you can just use them as a sequence. (That's how I use mairix.) (Also see contrib/msearch.)

If we're going to allow DT_LNK, code also needs changing in namescan and iterdir.

eiro commented 4 years ago

Note that mu find --fields l will just output the file name, then you can just use them as a sequence.

the thing is i see no reason to not support DT_LNK and there are plenty of possible usages.

(That's how I use mairix.) (Also see contrib/msearch.)

i would be curious about the reasons you chosen mairix. is there another channel to ask about it? (mailing list or something?)

If we're going to allow DT_LNK, code also needs changing in namescan and iterdir

if you like the idea, i would be happy to ammend the PR until it will please you.

regards marc

leahneukirchen commented 4 years ago

Mostly because mairix was around long before mu, also it's indexes are way smaller (but it has other limitations.)

I can adapt the patch myself, thanks. I'll get around to it in the next few days.

eiro commented 4 years ago

On Sat, Mar 07, 2020 at 06:53:02AM -0800, Leah Neukirchen wrote:

Mostly because mairix was around long before mu, also it's indexes are way smaller (but it has other limitations.)

thanks for this reply

I can adapt the patch myself, thanks. I'll get around to it in the next few days.

ok. it's probably faster for you to edit your code than doing review.

thanks a lot

eiro commented 4 years ago

i would had introduced something like

    #if defined(DT_REG) && defined(DT_LNK) && defined(DT_UNKNOWN)
    #define IS_LEGIT_DT(t) (t != DT_REG && t != DT_LNK && t != DT_UNKNOWN)
    #else
    #define IS_LEGIT_DT(t) (1)
    #endif

in a file like config.h and then add some other generic macros and configuration like

    #if defined(__linux__)
    #define __GNU_SOURCE__
    #endif

    #define uc ...
    #define lc ...

regards marc