diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-26 03:30:23 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-26 03:30:23 -0700 |
| commit | cbce79375392f457b1b9393e1eb750147838e096 (patch) | |
| tree | a7c9710dbeb3d628559ddc01c558b0278f77997c | |
| parent | c763a492f55b19dde1956d9d79551086f31de6b3 (diff) | |
| download | seaweedfs-cbce79375392f457b1b9393e1eb750147838e096.tar.xz seaweedfs-cbce79375392f457b1b9393e1eb750147838e096.zip | |
rename: set new name for renamed files
| -rw-r--r-- | weed/filesys/fscache.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/filesys/fscache.go b/weed/filesys/fscache.go index 7e5b0a68c..9114c91b2 100644 --- a/weed/filesys/fscache.go +++ b/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() |
