fspath

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fspath contains FS path manipulation tools, much like the standard library's "path/filepath" package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonBase

func CommonBase(a, b string) string

CommonBase returns the common base path between a and b. Returns "." if there are no common path elements.

func Rel

func Rel(basePath, targetPath string) (string, error)

Rel returns the relative FS path from basePath to targetPath. Similar to filepath.Rel without including OS-dependent behavior.

func WorkingDirectoryFS added in v0.1.4

func WorkingDirectoryFS() (*os.FS, error)

WorkingDirectoryFS returns the os.FS for the current working directory. If using Windows, the os.FS used will target the osPath's volume (e.g. C:\).

Types

This section is empty.

Jump to

Keyboard shortcuts

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