Documentation ¶
Overview ¶
Package file contains utilities for operating on files.
Index ¶
- func Append(name string, content []byte) error
- func Copy(oldpath, newpath string) error
- func Create(name string) error
- func DownloadWithCache(ctx context.Context, cacheDir, src, dest string, mode fs.FileMode, quiet bool) error
- func DownloadWithCacheAndExtract(ctx context.Context, cacheDir, src, dest string, match string, ...) error
- func Exists(name string) bool
- func MkdirAll(name string) error
- func Open(name string) (io.WriteCloser, error)
- func Read(name string) ([]byte, error)
- func Remove(name string) error
- func RemoveAll(name string) error
- func Rename(oldpath, newpath string) error
- func Write(name string, content []byte) error
- func WriteWithMode(name string, content []byte, mode os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadWithCache ¶
func DownloadWithCache(ctx context.Context, cacheDir, src, dest string, mode fs.FileMode, quiet bool) error
DownloadWithCache downloads the src file to the dest file.
func DownloadWithCacheAndExtract ¶
func DownloadWithCacheAndExtract(ctx context.Context, cacheDir, src, dest string, match string, mode fs.FileMode, quiet bool, clean bool) error
DownloadWithCacheAndExtract downloads the src file to the dest file, and extract it to the dest directory.
func Open ¶ added in v0.3.0
func Open(name string) (io.WriteCloser, error)
Open opens/creates a file for writing.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.