MCPcopy
hub / github.com/rclone/rclone / Split

Function Split

fs/fspath/path.go:302–310  ·  view source on GitHub ↗

Split splits a remote into a parent and a leaf if it returns leaf as an empty string then remote is a directory if it returns parent as an empty string then that means the current directory The returned values have the property that parent + leaf == remote (except under Windows where \ will be tr

(remote string)

Source from the content-addressed store, hash-verified

300// The returned values have the property that parent + leaf == remote
301// (except under Windows where \ will be translated into /)
302func Split(remote string) (parent string, leaf string, err error) {
303 remoteName, remotePath, err := SplitFs(remote)
304 if err != nil {
305 return "", "", err
306 }
307 // Construct new remote name without last segment
308 parent, leaf = path.Split(remotePath)
309 return remoteName + parent, leaf, nil
310}
311
312// Make filePath absolute so it can't read above the root
313func makeAbsolute(filePath string) string {

Callers 9

copyOrMoveIDMethod · 0.92
NewFsSrcDstFilesFunction · 0.92
NewFsDstFileFunction · 0.92
addRemoteFilesFunction · 0.92
newFsDstFunction · 0.92
runTestStepMethod · 0.92
copyFileMethod · 0.92
GetFsNamedFileOKFunction · 0.92
TestSplitFunction · 0.70

Calls 1

SplitFsFunction · 0.85

Tested by 3

runTestStepMethod · 0.74
copyFileMethod · 0.74
TestSplitFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…