nmh-workers
[Top] [All Lists]

[Nmh-workers] packf: asks user on file creation

2010-10-28 10:37:13
Hoi,

for becoming familiar with nmh's code base I read a lot of code, today
also uip/packf.c .  packf(1) asks the user for confirmation if the
output file is to be created but appends non-interactively if it
already exists.

Why is the behavior such?

What are the reasons behind the confirmation question on creation? I'd
rather have the question for appending to an existent file. But best
would be to be completely non-interactive, which is the Unix way to do
things, or am I wrong?

If the reason is to know where the file went, printing a message would
be enough.

The relevant code is uip/packf.c:114-125:

    /*
     * Check if file to be created (or appended to)
     * exists.  If not, ask for confirmation.
     */
    if (stat (file, &st) == NOTOK) {
        if (errno != ENOENT)
            adios (file, "error on file");
        cp = concat ("Create file \"", file, "\"? ", NULL);
        if (!getanswer (cp))
            done (1);
        free (cp);
    }

Actually, the comment is at least unclear, due to the words in
parenthesis.


Comments?


meillo

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

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