Skip to content

Commit

Permalink
cmd/ipfswatch/main: Replace coreunix.Add with coreunix.AddR
Browse files Browse the repository at this point in the history
No need to convert from a path to a reader locally, when AddR will do
that for us.  This also future-proofs us from AddR enhancements that
will pull other information about the added file from the filesystem
besides the data (e.g. access mode, owner and group ID, ...).
  • Loading branch information
wking committed May 1, 2015
1 parent 0ce5784 commit bf9b9fc
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cmd/ipfswatch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,7 @@ func run(ipfsPath, watchPath string) error {
}
}
proc.Go(func(p process.Process) {
file, err := os.Open(e.Name)
if err != nil {
log.Println(err)
}
defer file.Close()
k, err := coreunix.Add(node, file)
k, err := coreunix.AddR(node, e.Name)
if err != nil {
log.Println(err)
}
Expand Down

0 comments on commit bf9b9fc

Please sign in to comment.