[Top] [All Lists]

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

2016-02-25 09:28:52
ken wrote:
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.

okay.  i can live with that.

i don't think the behavior needs to change, although perhaps it
shouldn't have been so easy to create the folder in the first place.
    $ refile +1234
    Create folder "/home/pgf/Mail/1234"? 

a quick look says that create_folder() and rcvstore.c:main() might be
candidates for an error check.  there's also make_intermediates(), but
it's a utility function, and i don't think that it's ever used to
create a folder.

in the meantime, any objections if i add this new section to
mh-folders.man, or something like it?
        nmh folders can be given arbitrary names, with one exception: 
        folders should not be given all-numeric names.  This
        limitation results from nmh messages themselves being stored
        in numerically named files -- allowing folders to be named
        similarly would make nmh slower, and introduce usage ambiguities.


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.


Nmh-workers mailing list

 paul fox, pgf(_at_)foxharp(_dot_)boston(_dot_)ma(_dot_)us (arlington, ma, 
where it's 53.2 degrees)

Nmh-workers mailing list

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