[Top] [All Lists]

Re: [Nmh-workers] mh and mairix and numerically named folders

2016-02-25 09:26:19
Ken Hornstein <kenh(_at_)pobox(_dot_)com> writes:
so my question, before i report this as a limitation with mairix:  is
there any reason that an MH folder shouldn't have an all-numeric name?
i did grep the man pages a bit, but didn't find a specification for
folder names

So, the answer is ... you should not have a folder with an all-numeric name.

I looked at folder_read(), the main function that nmh uses to scan a
folder and create the folder structure (which contains an index of all
valid messages).  It calls readdir() on a directory and checks to see if
atoi() works on the filename; if it succeeds then it assumes that it's a
message.  It does NOT check if the file is a directory or not (normally
stat() is not called on every message as that would be too expensive).
In theory you could use d_type that's part of struct dirent to see if
it's a file or not, but not all operating systems or filesystems support
that and I am reluctant to change long-standing practice for what is
admittedly an edge case.

While it may 'work' in the short term, I think like Conrad said you'll
run into problems in the long run.

It is interesting that, to the best of my memory, we never considered the
possibility that an MH directory could have a numeric name. Though, that
might be more a function of my memory than of history.

We certainly did consider and extensively discuss possible message names
before deciding that they were to be numeric.

    Norman Shapiro

Nmh-workers mailing list

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