Browse Source

rename: set new name for renamed files

pull/1255/head
Chris Lu 5 years ago
parent
commit
cbce793753
  1. 6
      weed/filesys/fscache.go

6
weed/filesys/fscache.go

@ -94,6 +94,12 @@ func (c *FsCache) Move(oldPath util.FullPath, newPath util.FullPath) *FsNode {
if dir, ok := src.node.(*Dir); ok {
dir.name = target.name // target is not Dir, but a shortcut
}
if f, ok := src.node.(*File); ok {
f.Name = target.name // target is not Dir, but a shortcut
if f.entry != nil {
f.entry.Name = f.Name
}
}
parent.disconnectChild(target)
target.deleteSelf()

Loading…
Cancel
Save