mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 17:37:23 +08:00
file path supports windows, avoiding back slashes
fix https://github.com/chrislusf/seaweedfs/issues/868
This commit is contained in:
@@ -41,7 +41,7 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector
|
||||
|
||||
func moveEntry(ctx context.Context, client filer_pb.SeaweedFilerClient, oldParent string, entry *filer_pb.Entry, newParent, newName string) error {
|
||||
if entry.IsDirectory {
|
||||
currentDirPath := filepath.Join(oldParent, entry.Name)
|
||||
currentDirPath := filepath.ToSlash(filepath.Join(oldParent, entry.Name))
|
||||
|
||||
lastFileName := ""
|
||||
includeLastFile := false
|
||||
@@ -65,7 +65,7 @@ func moveEntry(ctx context.Context, client filer_pb.SeaweedFilerClient, oldParen
|
||||
|
||||
for _, item := range resp.Entries {
|
||||
lastFileName = item.Name
|
||||
err := moveEntry(ctx, client, currentDirPath, item, filepath.Join(newParent, newName), item.Name)
|
||||
err := moveEntry(ctx, client, currentDirPath, item, filepath.ToSlash(filepath.Join(newParent, newName)), item.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user