aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/path.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-17 21:57:07 +0800
committerobscuren <geffobscura@gmail.com>2014-09-17 21:57:07 +0800
commitfd041d91ee9f4be2d4705a32dc16698c89622c85 (patch)
treec8553f5c70eb34aed83c7d557a0f9f0c3eeb750f /ethutil/path.go
parent1549a29c9d6452eefa615baedfccfc5b5f6b7745 (diff)
downloaddexon-fd041d91ee9f4be2d4705a32dc16698c89622c85.tar
dexon-fd041d91ee9f4be2d4705a32dc16698c89622c85.tar.gz
dexon-fd041d91ee9f4be2d4705a32dc16698c89622c85.tar.bz2
dexon-fd041d91ee9f4be2d4705a32dc16698c89622c85.tar.lz
dexon-fd041d91ee9f4be2d4705a32dc16698c89622c85.tar.xz
dexon-fd041d91ee9f4be2d4705a32dc16698c89622c85.tar.zst
dexon-fd041d91ee9f4be2d4705a32dc16698c89622c85.zip
Truncate when writing
Diffstat (limited to 'ethutil/path.go')
-rw-r--r--ethutil/path.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethutil/path.go b/ethutil/path.go
index 27022bcfa..cfbc38950 100644
--- a/ethutil/path.go
+++ b/ethutil/path.go
@@ -45,7 +45,7 @@ func ReadAllFile(filePath string) (string, error) {
}
func WriteFile(filePath string, content []byte) error {
- fh, err := os.OpenFile(filePath, os.O_RDWR|os.O_CREATE, os.ModePerm)
+ fh, err := os.OpenFile(filePath, os.O_TRUNC|os.O_RDWR|os.O_CREATE, os.ModePerm)
if err != nil {
return err
}