add interactive flag to cp/mv to avoid overwrite
This commit is contained in:
1 parent
460ccbea4a
commit
f907a553ae
1 file changed
+8
@@ -72,6 +72,14 @@ func putCommand(list []string, dir *dir, copy bool) *exec.Cmd {
|
|||||||
} else {
|
} else {
|
||||||
sh = "mv"
|
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, list...)
|
||||||
args = append(args, dir.path)
|
args = append(args, dir.path)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user