Documentation ¶
Index ¶
- func AppendAll(filename string, data []byte) error
- func AppendFileAll(filename string, data []byte, dirperm, fileperm os.FileMode) error
- func TempAll(dir, pattern string) (f *os.File, err error)
- func TempFileAll(dir, pattern string, dirperm os.FileMode) (f *os.File, err error)
- func WriteAll(filename string, data []byte) error
- func WriteFileAll(filename string, data []byte, dirperm, fileperm os.FileMode) error
- func WriteRenameAll(filename string, data []byte) error
- func WriteRenameFileAll(filename string, data []byte, dirperm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAll ¶
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.
func AppendFileAll ¶
AppendFileAll appends 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 appends it before writing, without changing permissions.
func TempAll ¶ added in v0.0.150
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.
func TempFileAll ¶ added in v0.0.150
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).
func WriteAll ¶
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.
func WriteFileAll ¶
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.
func WriteRenameAll ¶ added in v0.0.150
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.
func WriteRenameFileAll ¶ added in v0.0.150
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.
Types ¶
This section is empty.