ioutil

package
v1.2.86 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendAll

func AppendAll(filename string, data []byte) error

AppendAll appends data to a file named by filename. If the file does not exist, AppendAll creates it with mode 0666 (before umask) If the dir does not exist, AppendAll creates it with 0755 (before umask) (before umask); otherwise AppendAll appends it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.AppendAll.

func AppendAllFrom

func AppendAllFrom(filename string, r io.Reader) error

AppendAllFrom appends data to a file named by filename from r until EOF or error. If the file does not exist, AppendAllFrom creates it with mode 0666 (before umask) If the dir does not exist, AppendAllFrom creates it with 0755 (before umask) (before umask); otherwise AppendAllFrom appends it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.AppendAllFrom.

func AppendFileAll

func AppendFileAll(filename string, data []byte, dirperm, fileperm os.FileMode) error

AppendFileAll is the generalized open call; most users will use AppendAll instead. It appends data to a file named by filename. If the file does not exist, AppendFileAll creates it with permissions fileperm (before umask) If the dir does not exist, AppendFileAll creates it with permissions dirperm (before umask) otherwise AppendFileAll appends it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.AppendFileAll.

func AppendFileAllFrom

func AppendFileAllFrom(filename string, r io.Reader, dirperm, fileperm os.FileMode) error

AppendFileAllFrom is the generalized open call; most users will use AppendFileFrom instead. It appends data to a file named by filename from r until EOF or error. If the file does not exist, AppendFileAllFrom creates it with permissions fileperm (before umask) If the dir does not exist, AppendFileAllFrom creates it with permissions dirperm (before umask) otherwise AppendFileAllFrom appends it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.AppendFileAllFrom.

func TempAll

func TempAll(dir, pattern string) (f *os.File, err error)

TempAll creates a new temporary file in the directory dir, opens the file for reading and writing, and returns the resulting *os.File. If the file does not exist, TempAll creates it with mode 0600 (before umask) If the dir does not exist, TempAll creates it with 0755 (before umask) otherwise TempAll truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.TempAll.

func TempFileAll

func TempFileAll(dir, pattern string, dirperm os.FileMode) (f *os.File, err error)

TempFileAll is the generalized open call; most users will use TempAll instead. If the directory does not exist, it is created with mode dirperm (before umask).

As of Go 1.16, this function simply calls os.TempFileAll.

func WriteAll

func WriteAll(filename string, data []byte) error

WriteAll writes data to a file named by filename. If the file does not exist, WriteAll creates it with mode 0666 (before umask) If the dir does not exist, WriteAll creates it with 0755 (before umask) otherwise WriteAll truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteAll.

func WriteAllFrom

func WriteAllFrom(filename string, r io.Reader) error

WriteAllFrom writes data to a file named by filename from r until EOF or error. If the file does not exist, WriteAll creates it with mode 0666 (before umask) If the dir does not exist, WriteAll creates it with 0755 (before umask) otherwise WriteAll truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteAllFrom.

func WriteFileAll

func WriteFileAll(filename string, data []byte, dirperm, fileperm os.FileMode) error

WriteFileAll is the generalized open call; most users will use WriteAll instead. It writes data to a file named by filename. If the file does not exist, WriteFileAll creates it with permissions fileperm (before umask) If the dir does not exist, WriteFileAll creates it with permissions dirperm (before umask) otherwise WriteFileAll truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteFileAll.

func WriteFileAllFrom

func WriteFileAllFrom(filename string, r io.Reader, dirperm, fileperm os.FileMode) error

WriteFileAllFrom is the generalized open call; most users will use WriteAllFrom instead. It writes data to a file named by filename from r until EOF or error. If the file does not exist, WriteFileAllFrom creates it with permissions fileperm (before umask) If the dir does not exist, WriteFileAllFrom creates it with permissions dirperm (before umask) otherwise WriteFileAllFrom truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteFileAllFrom.

func WriteRenameAll

func WriteRenameAll(filename string, data []byte) error

WriteRenameAll writes data to a temp file and rename to the new file named by filename. If the file does not exist, WriteRenameAll creates it with mode 0666 (before umask) If the dir does not exist, WriteRenameAll creates it with 0755 (before umask) otherwise WriteRenameAll truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteRenameAll.

func WriteRenameAllFrom

func WriteRenameAllFrom(filename string, r io.Reader) error

WriteRenameAllFrom writes data to a temp file from r until EOF or error, and rename to the new file named by filename. WriteRenameAllFrom is safer than WriteAllFrom as before Write finished, nobody can find the unfinished file. If the file does not exist, WriteRenameAllFrom creates it with mode 0666 (before umask) If the dir does not exist, WriteRenameAllFrom creates it with 0755 (before umask) otherwise WriteRenameAllFrom truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteRenameAllFrom.

func WriteRenameFileAll

func WriteRenameFileAll(filename string, data []byte, dirperm os.FileMode) error

WriteRenameFileAll is the generalized open call; most users will use WriteRenameAll instead. WriteRenameFileAll is safer than WriteFileAll as before Write finished, nobody can find the unfinished file. It writes data to a temp file and rename to the new file named by filename. If the file does not exist, WriteRenameFileAll creates it with permissions fileperm If the dir does not exist, WriteRenameFileAll creates it with permissions dirperm (before umask); otherwise WriteRenameFileAll truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteRenameFileAllFrom.

func WriteRenameFileAllFrom

func WriteRenameFileAllFrom(filename string, r io.Reader, dirperm os.FileMode) error

WriteRenameFileAllFrom is the generalized open call; most users will use WriteRenameAllFrom instead. WriteRenameFileAllFrom is safer than WriteRenameAllFrom as before Write finished, nobody can find the unfinished file. It writes data to a temp file and rename to the new file named by filename. If the file does not exist, WriteRenameFileAllFrom creates it with permissions fileperm If the dir does not exist, WriteRenameFileAllFrom creates it with permissions dirperm (before umask); otherwise WriteRenameFileAllFrom truncates it before writing, without changing permissions.

As of Go 1.16, this function simply calls os.WriteRenameFileAllFrom.

Types

This section is empty.

Jump to

Keyboard shortcuts

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