The Great Rewrite (fixes #36, #61, #94, #101)

Rewrite of the file model and pulling mechanism. Needs lots of cleanup
and bugfixes, now...
This commit is contained in:
Jakob Borg
2014-03-28 14:36:57 +01:00
parent 3700eb1e61
commit f87b1520e8
47 changed files with 2137 additions and 1902 deletions

View File

@@ -7,7 +7,7 @@ import (
"io/ioutil"
mr "math/rand"
"os"
"path"
"path/filepath"
"time"
)
@@ -27,7 +27,7 @@ func main() {
for i := 0; i < files; i++ {
n := name()
p0 := path.Join(string(n[0]), n[0:2])
p0 := filepath.Join(string(n[0]), n[0:2])
os.MkdirAll(p0, 0755)
s := 1 << uint(mr.Intn(maxexp))
a := 128 * 1024
@@ -37,7 +37,7 @@ func main() {
s += mr.Intn(a)
b := make([]byte, s)
rand.Reader.Read(b)
p1 := path.Join(p0, n)
p1 := filepath.Join(p0, n)
ioutil.WriteFile(p1, b, 0644)
os.Chmod(p1, os.FileMode(mr.Intn(0777)|0400))