fspath

package
v1.48.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2019 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fspath contains routines for fspath manipulation

Index

Constants

This section is empty.

Variables

View Source
var Matcher = regexp.MustCompile(`^(:?[\w_ -]+):(.*)$`)

Matcher is a pattern to match an rclone URL

Functions

func JoinRootPath added in v1.46.0

func JoinRootPath(elem ...string) string

JoinRootPath joins any number of path elements into a single path, adding a separating slash if necessary. The result is Cleaned; in particular, all empty strings are ignored. If the first non empty element has a leading "//" this is preserved.

func Parse

func Parse(path string) (configName, fsPath string)

Parse deconstructs a remote path into configName and fsPath

If the path is a local path then configName will be returned as "".

So "remote:path/to/dir" will return "remote", "path/to/dir" and "/path/to/local" will return ("", "/path/to/local")

Note that this will turn \ into / in the fsPath on Windows

func Split

func Split(remote string) (parent string, leaf string)

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 translated into /)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL