filesystem

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsolutePath

func AbsolutePath(path string) (string, error)

AbsolutePath converts a path (relative or absolute) into an absolute one. Supports '~' notation for $HOME directory of the current user.

func CreateDirIfDoesNotExist

func CreateDirIfDoesNotExist(path string) error

CreateDirIfDoesNotExist creates a directory if the specified path does not exist

func EmptyDir

func EmptyDir(path string) error

EmptyDir removes all files and folders inside the specified path. It could be similar to RemoveAll() but without removing the folder itself.

func EmptyOrCreateDir

func EmptyOrCreateDir(path string) error

EmptyOrCreateDir create a new folder or empty an existing one

func GetMTime

func GetMTime(path string) (mtime time.Time, err error)

GetMTime returns the Last Modified time from the file

func IsDir

func IsDir(path string) bool

IsDir asserts there is a directory at path

func IsFile

func IsFile(path string) bool

IsFile asserts there is a file at path

func RelativePath

func RelativePath(basepath, path string) string

RelativePath returns a path relative to the given base path. If the path is not under the given base path, the specified path is returned. So all returned paths are under the base path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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