Commit c614b5b8 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Update for Go weekly.2011-06-16

parent b68d8e7f
......@@ -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"
......@@ -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 {
......@@ -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 {
......
......@@ -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()
......
......@@ -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
}
......@@ -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])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment