MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / Move

Method Move

drivers/smb/driver.go:112–125  ·  view source on GitHub ↗
(ctx context.Context, srcObj, dstDir model.Obj)

Source from the content-addressed store, hash-verified

110}
111
112func (d *SMB) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
113 if err := d.checkConn(ctx); err != nil {
114 return err
115 }
116 srcPath := srcObj.GetPath()
117 dstPath := filepath.Join(dstDir.GetPath(), srcObj.GetName())
118 err := d.fs.Rename(srcPath, dstPath)
119 if err != nil {
120 d.cleanLastConnTime()
121 return err
122 }
123 d.updateLastConnTime()
124 return nil
125}
126
127func (d *SMB) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
128 if err := d.checkConn(ctx); err != nil {

Callers

nothing calls this directly

Calls 6

checkConnMethod · 0.95
cleanLastConnTimeMethod · 0.95
updateLastConnTimeMethod · 0.95
GetPathMethod · 0.65
GetNameMethod · 0.65
RenameMethod · 0.65

Tested by

no test coverage detected