TRUNC new file
This commit is contained in:
parent
d9be1a53fb
commit
df5d2abea4
|
@ -136,7 +136,7 @@ func configWrite(data []byte) error {
|
|||
homeDir, err := os.UserHomeDir()
|
||||
p := filepath.Join(homeDir, ".config/zookeeper")
|
||||
fname := filepath.Join(p, "zookeeper.pb")
|
||||
cfgfile, err := os.OpenFile(fname, os.O_RDWR|os.O_CREATE, 0666)
|
||||
cfgfile, err := os.OpenFile(fname, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
|
||||
defer cfgfile.Close()
|
||||
if err != nil {
|
||||
log.Warn("open config file :", err)
|
||||
|
@ -149,7 +149,7 @@ func configWrite(data []byte) error {
|
|||
func (m *Machine) configWrite(fname string, data []byte) error {
|
||||
fullname := filepath.Join(os.Getenv("FORGE_HOME"), fname)
|
||||
|
||||
cfgfile, err := os.OpenFile(fullname, os.O_RDWR|os.O_CREATE, 0666)
|
||||
cfgfile, err := os.OpenFile(fullname, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
|
||||
defer cfgfile.Close()
|
||||
if err != nil {
|
||||
log.Warn("open config file :", err)
|
||||
|
|
Loading…
Reference in New Issue