WriteFile writes the pipe's contents to the file path, truncating it if it exists, and returns the number of bytes successfully written, or an error.
(path string)
| 1017 | // WriteFile writes the pipe's contents to the file path, truncating it if it |
| 1018 | // exists, and returns the number of bytes successfully written, or an error. |
| 1019 | func (p *Pipe) WriteFile(path string) (int64, error) { |
| 1020 | return p.writeOrAppendFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC) |
| 1021 | } |
| 1022 | |
| 1023 | func (p *Pipe) writeOrAppendFile(path string, mode int) (int64, error) { |
| 1024 | if p.Error() != nil { |