fileutil

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fileutil provides file utility functions, complementing the lower level abstractions found in the standard library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Getwd added in v0.2.0

func Getwd() string

Getwd returns a rooted path name corresponding to the current directory. If the current directory can be reached via multiple paths (due to symbolic links), Getwd may return any one of them.

On failure, will return "."

func IsReadableFile

func IsReadableFile(path string) (bool, error)

IsReadableFile reports whether the file exists and is readable. If the error is non-nil, it means there might be a file or directory with that name but we cannot read it.

Adapted from the upspin.io source code.

Types

type Watcher added in v0.12.2

type Watcher struct {
	*signal.Signal
	// contains filtered or unexported fields
}

A Watcher watches files for changes.

func NewWatcher added in v0.12.2

func NewWatcher() *Watcher

NewWatcher creates a new Watcher.

func (*Watcher) Add added in v0.12.2

func (watcher *Watcher) Add(filePath string)

Add adds a new watch.

func (*Watcher) Clear added in v0.12.2

func (watcher *Watcher) Clear()

Clear removes all watches.

Jump to

Keyboard shortcuts

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