upath

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package upath contains utilities for dealing with symlinked paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsSymlink(originalFile, target string) string

AbsSymlink returns an absolute path for the link from a file to a target.

func IsTargetSymlink(originalFile, target string) bool

IsTargetSymlink returns true if a target of a symlink is also a symlink.

func ResolveUntilLastSymlink(p string) string

ResolveUntilLastSymlink resolves until the last symlink.

This is needed when we have a chain of symlinks and want the last symlink, not the file pointed to (which is why we don't use filepath.EvalSymlinks)

I.e.

/foo/bar -> ../baz/foo /baz/foo -> bla

ResolveUntilLastSymlink(/foo/bar) returns /baz/foo.

func UrootPath

func UrootPath(n ...string) string

UrootPath returns the absolute path for a uroot file with the UROOT_ROOT environment variable taken into account.

It returns a proper value if UROOT_ROOT is not set. u-root was built to assume everything is rooted at /, and in most cases that is still true. But in hosted mode, e.g. on developer mode chromebooks, it's far better if u-root can be rooted in /usr/local, so successive kernel/root file system upgrades do not wipe it out.

Types

This section is empty.

Jump to

Keyboard shortcuts

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