file

package
v1.0.63 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package file provides helpers to work with files.

Index

Constants

View Source
const (
	UserPath = "PATH"
)

Variables

View Source
var (
	ErrCloseFile       = errors.New("file: file close error")
	ErrFileNotFound    = errors.New("file: file not found")
	ErrInvalidFilename = errors.New("file: invalid filename")
	ErrInvalidTriplet  = errors.New("file: invalid triplet")
	ErrOpenFile        = errors.New("file: failed to open file")
	ErrScanFile        = errors.New("file: file scan error")
)

Functions

func BinaryMode added in v1.0.38

func BinaryMode(filename string) (string, error)

BinaryMode returns the file mode of filename in binary digits.

func GetStrings added in v1.0.49

func GetStrings(filename string, ignoreCase bool) ([]string, error)

GetStrings reads all lines from filename and returns a slice of string.

func IsExecutableInPath added in v1.0.38

func IsExecutableInPath(filename string) (bool, error)

IsExecutableInPath returns true if filename is an executable and exists in the user PATH.

Types

This section is empty.

Jump to

Keyboard shortcuts

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