Skip to content

Commit

Permalink
Update for Go weekly.2011-06-16
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwen committed Jun 19, 2011
1 parent b68d8e7 commit c614b5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 4 additions & 5 deletions example/bulkstat/bulkstat.go
Expand Up @@ -4,7 +4,7 @@ package main
// in parallel. This is useful for benchmarking purposes.

import (
"encoding/line"
"bufio"
"flag"
"fmt"
"github.com/hanwen/go-fuse/fuse"
Expand All @@ -31,8 +31,7 @@ func main() {
panic("err" + err.String())
}

linelen := 1000
reader := line.NewReader(f, linelen)
reader := bufio.NewReader(f)

files := make([]string, 0)
for {
Expand Down Expand Up @@ -64,8 +63,8 @@ func main() {
}

func Analyze(times []float64) {
sorted := sort.Float64Array(times)
sorted.Sort()
sorted := times
sort.SortFloat64s(sorted)

tot := 0.0
for _, v := range times {
Expand Down
4 changes: 3 additions & 1 deletion fuse/pathdebug.go
Expand Up @@ -51,8 +51,10 @@ func (me *FileSystemDebug) Open(path string, flags uint32) (fuseFile File, statu
return me.FileSystem.Open(path, flags)
}

var SeparatorString = string([]byte{filepath.Separator})

func (me *FileSystemDebug) getContent(path string) []byte {
comps := strings.Split(path, filepath.SeparatorString, -1)
comps := strings.Split(path, SeparatorString, -1)
if comps[0] == DebugDir {
me.RWMutex.RLock()
defer me.RWMutex.RUnlock()
Expand Down
4 changes: 2 additions & 2 deletions unionfs/autounion.go
Expand Up @@ -173,7 +173,7 @@ func (me *AutoUnionFs) updateKnownFses() {
}

func (me *AutoUnionFs) Readlink(path string) (out string, code fuse.Status) {
comps := strings.Split(path, filepath.SeparatorString, -1)
comps := strings.Split(path, fuse.SeparatorString, -1)
if comps[0] == _STATUS && comps[1] == _ROOT {
return me.root, fuse.OK
}
Expand Down Expand Up @@ -265,7 +265,7 @@ func (me *AutoUnionFs) GetAttr(path string) (*os.FileInfo, fuse.Status) {
}
return a, fuse.OK
}
comps := strings.Split(path, filepath.SeparatorString, -1)
comps := strings.Split(path, fuse.SeparatorString, -1)

if len(comps) > 1 && comps[0] == _CONFIG {
fs := me.getUnionFs(comps[1])
Expand Down

0 comments on commit c614b5b

Please sign in to comment.