file

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDirectory

func ClearDirectory(path string, flat bool) error

func Copy

func Copy(src, dest string) (int64, error)

func Delete

func Delete(fname string) error

func Exists

func Exists(fname string) bool

func GenerateRandomFilename

func GenerateRandomFilename(url, root, path string) (string, string, error)

func Mkdir

func Mkdir(path string) error

func Move

func Move(src, dst string) error

func Read

func Read(fname string) ([]byte, error)

func Rmdir

func Rmdir(path string) error

func TouchWithPath

func TouchWithPath(fname string, template string) error

TouchWithPath ensures that file "fname" exists. If file does not exist, it is created as a copy of the specified template, including all the necessary parent directories.

func URLFileExtension

func URLFileExtension(addr string) string

Types

type FileInterface

type FileInterface interface {
	Exists(fname string) bool
	Copy(src, dest string) (int64, error)
	Delete(fname string) error
	Mkdir(path string) error
	Rmdir(path string) error
	Move(src, dst string) error
	URLFileExtension(addr string) string
	Read(fname string) (contents []byte, err error)
	TouchWithPath(fname string, template string) error
	ClearDirectory(path string) error
}

Jump to

Keyboard shortcuts

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