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


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to