a correct implementation of filer

This commit is contained in:
Chris Lu
2014-04-09 09:44:58 -07:00
parent 67be8a5af8
commit abde40377c
10 changed files with 536 additions and 148 deletions

View File

@@ -1,6 +1,7 @@
package util
import (
"bufio"
"code.google.com/p/weed-fs/go/glog"
"errors"
"os"
@@ -21,3 +22,16 @@ func TestFolderWritable(folder string) (err error) {
}
return errors.New("Not writable!")
}
func Readln(r *bufio.Reader) ([]byte, error) {
var (
isPrefix bool = true
err error = nil
line, ln []byte
)
for isPrefix && err == nil {
line, isPrefix, err = r.ReadLine()
ln = append(ln, line...)
}
return ln, err
}