(pipe string, contents []byte)
| 21 | } |
| 22 | |
| 23 | func WritePipe(pipe string, contents []byte) { |
| 24 | handle, err := os.OpenFile(pipe, os.O_WRONLY, 0600) |
| 25 | |
| 26 | if err != nil { |
| 27 | os.Remove(pipe) |
| 28 | log.Fatal(err) |
| 29 | } |
| 30 | |
| 31 | handle.Write(contents) |
| 32 | handle.Close() |
| 33 | } |
| 34 | |
| 35 | func GetPipe(dir, filename string) (string, error) { |
| 36 | tmpfn := filepath.Join(dir, filename) |