MCPcopy
hub / github.com/rclone/rclone / cleanRootFromPath

Method cleanRootFromPath

backend/cache/cache.go:1827–1836  ·  view source on GitHub ↗

cleanRootFromPath trims the root of the current fs from a path

(p string)

Source from the content-addressed store, hash-verified

1825
1826// cleanRootFromPath trims the root of the current fs from a path
1827func (f *Fs) cleanRootFromPath(p string) string {
1828 if f.Root() != "" {
1829 p = p[len(f.Root()):] // trim out root
1830 if len(p) > 0 { // remove first separator
1831 p = p[1:]
1832 }
1833 }
1834
1835 return p
1836}
1837
1838func (f *Fs) isRootInPath(p string) bool {
1839 if f.Root() == "" {

Callers 4

ListMethod · 0.95
runMethod · 0.80
RemoteMethod · 0.80
RemoteMethod · 0.80

Calls 1

RootMethod · 0.95

Tested by

no test coverage detected