fs

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

FS is the global filesystem interface

Functions

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a file from src to dst with permissions

func Create

func Create(name string) (afero.File, error)

Create creates or truncates the named file

func MkdirAll

func MkdirAll(path string, perm os.FileMode) error

MkdirAll creates a directory named path, along with any necessary parents

func MoveFile

func MoveFile(src, dst string) error

func Open

func Open(name string) (afero.File, error)

Open opens the named file for reading

func OpenFile

func OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

OpenFile is the generalized open call

func ReadFile

func ReadFile(filename string) ([]byte, error)

ReadFile reads the named file and returns the contents

func Remove

func Remove(name string) error

Remove removes the named file or directory

func Rename

func Rename(oldname, newname string) error

Rename renames (moves) oldpath to newpath

func Stat

func Stat(name string) (os.FileInfo, error)

Stat returns a FileInfo describing the named file

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile writes data to the named file, creating it if necessary

Types

This section is empty.

Jump to

Keyboard shortcuts

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