don't trash files on different filesystems, and say it when it happens
This commit is contained in:
parent
99a3bed240
commit
94864ff344
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue