don't trash files on different filesystems, and say it when it happens
This commit is contained in:
parent
99a3bed240
commit
94864ff344
|
@ -161,6 +161,9 @@ func TrashFile(trashDir, name string) error {
|
||||||
|
|
||||||
// TODO: write across filesystems
|
// TODO: write across filesystems
|
||||||
if err := os.Rename(name, out_path); err != nil {
|
if err := os.Rename(name, out_path); err != nil {
|
||||||
|
if strings.Contains(err.Error(), "invalid cross-device link") {
|
||||||
|
return fmt.Errorf("not trashing file '%s': On different filesystem from trash directory", name)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue