file

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package file provides file operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendContents

func AppendContents(path string, content []byte) error

AppendContents append content to give file

func Copy

func Copy(src string, dst string) error

Copy file from src to dst

func Dir

func Dir(filename string) string

Dir return file dir

func Exists

func Exists(path string) bool

Exists check is file exists

func GetBinContents

func GetBinContents(path string) []byte

GetBinContents read file content as bytes

func GetContents

func GetContents(path string) string

GetContents read file content

func IsExec

func IsExec(filename string) bool

IsExec check is executable file

func Mkdir

func Mkdir(fpath string) error

Mkdir create dir like mkdir -p

func PutContents

func PutContents(path string, content []byte) error

PutContents write content to given file

func Remove

func Remove(path string) error

Remove file

func TempDir

func TempDir() string

TempDir returns the OS temp dir

func Truncate

func Truncate(path string, size int) error

Truncate changes the size of the named file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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