[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: markus schnalke
Subject: [Nmh-workers] packf: asks user on file creation
Date: Thu, 28 Oct 2010 17:36:56 +0200
User-agent: nmh 1.3


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]