fs

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 8 Imported by: 5

README

go-filesystem

Go Reference Go Report Card codecov license GitHub release (latest by date)

Install

go get -u github.com/eleven26/go-filesystem

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Separator = fmt.Sprintf("%c", os.PathSeparator)

Functions

func AllFiles

func AllFiles(dir string) (files []string, err error)

func Append

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

func Basename

func Basename(path string) string

func Chmod

func Chmod(path string, mode fs.FileMode) error

func Copy

func Copy(src, dst string) error

func CopyDirectory

func CopyDirectory(dir, dest string) error

func Delete

func Delete(paths ...string) error

func DeleteDirectory

func DeleteDirectory(path string) error

func Directories

func Directories(dir string) (dirs []string, err error)

func Dirname

func Dirname(path string) string

func Exists

func Exists(path string) (bool, error)

func Extension

func Extension(path string) string

func Files

func Files(dir string) (files []string, err error)

Files List the files under the folder, excluding directories.

func Get

func Get(path string) (b []byte, err error)

func GetString

func GetString(path string) (content string, err error)

func IsDirectory

func IsDirectory(path string) (bool, error)

func IsFile

func IsFile(path string) (bool, error)

func IsReadable

func IsReadable(path string) (bool, error)

func IsWritable

func IsWritable(path string) (bool, error)

func LastModified

func LastModified(path string) (t time.Time, err error)
func Link(src, dst string) error

func MakeDirectories

func MakeDirectories(path string, mode os.FileMode) error

func MakeDirectory

func MakeDirectory(path string, mode os.FileMode) error

func Move

func Move(from string, to string) error

func MoveDirectory

func MoveDirectory(src, dst string) error

func MustGet

func MustGet(path string) []byte

func MustGetString

func MustGetString(path string) string

func Name

func Name(path string) string

func Prepend

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

func Put

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

func PutString

func PutString(path string, content string) error

func Size

func Size(path string) (int64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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