bug-coreutils
[Top][All Lists]
Advanced

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

mv --reply=no doesn't work well


From: Thomas Rachel
Subject: mv --reply=no doesn't work well
Date: Sun, 10 Jul 2005 07:15:11 +0200
User-agent: KMail/1.6.2

Hi,

I recently deteted that if I use mv --reply=no, it doesn't behave as if I 
pressed 'n' on mv -i. The reason seems to be usage of the first "UNWRITABLE" 
in the following lines from src/copy.c (the 2nd one seems ok...):

              if (x->move_mode)
                {
                  if ((x->interactive == I_ALWAYS_NO
                       && UNWRITABLE (dst_path, dst_sb.st_mode))
                      || ((x->interactive == I_ASK_USER
                           || (x->interactive == I_UNSPECIFIED
                               && x->stdin_tty
                               && UNWRITABLE (dst_path, dst_sb.st_mode)))
                          && (overwrite_prompt (dst_path, &dst_sb), 1)
                          && ! yesno ()))
                    {
                      /* Pretend the rename succeeded, so the caller (mv)
                         doesn't end up removing the source file.  */
                      if (rename_succeeded)
                        *rename_succeeded = 1;
                      return 0;
                    }
                }

so that the 'no' is assumed only if the mv would fail because of missing 
rights.

Is there a reason for this? The info page says
`--reply[=HOW]'
     Specifying `--reply=yes' is equivalent to using `--force'.
     Specify `--reply=no' to make `mv' act as if `no' were given as a
     response to every prompt about a destination file.  Specify
     `--reply=query' to make `mv' prompt the user about each existing
     destination file.

Thomas




reply via email to

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