lib/model: Refactor out scanning method from rwfolder.Serve loop

This commit is contained in:
Michael Ploujnikov
2016-03-30 06:53:47 +00:00
committed by Jakob Borg
parent 8044522691
commit 66f480519b
3 changed files with 44 additions and 64 deletions

View File

@@ -14,6 +14,7 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"os"
@@ -544,3 +545,13 @@ func startInstance(t *testing.T, i int) *rc.Process {
p.AwaitStartup()
return p
}
func symlinksSupported() bool {
tmp, err := ioutil.TempDir("", "symlink-test")
if err != nil {
return false
}
defer os.RemoveAll(tmp)
err = os.Symlink("tmp", filepath.Join(tmp, "link"))
return err == nil
}