Documentation ¶
Index ¶
- func AppendAll(filename string, data []byte) error
- func AppendFileAll(filename string, data []byte, dirperm, fileperm os.FileMode) 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 If the dir does not exist, WriteFileAll creates it with permissions dirperm (before umask); otherwise WriteFileAll appends it before writing, without changing permissions.
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) (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 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) (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.