diff --git a/os.go b/os.go index 0b193a25..01b8a624 100644 --- a/os.go +++ b/os.go @@ -72,6 +72,14 @@ func putCommand(list []string, dir *dir, copy bool) *exec.Cmd { } else { sh = "mv" } + + // XXX: POSIX standard states that -i flag shall do nothing when the + // response is not affirmative. Since this command is run with a nil stdin, + // it should not give an affirmative answer and in return this command + // should not overwrite existing files. Our intention here is to use the + // standard -i flag in place of non-standard -n flag to avoid overwrites. + args = append(args, "-i") + args = append(args, list...) args = append(args, dir.path)