file: Overhaul file resource and add recursion

The file resource contained some of the early golang code that I wrote
for this project. Needless to say, some of it was quite yucky, and it
was also lacking a number of important features. This patch builds upon
it so that it starts being usable for directories of files too.

Many thanks to Sam Gélineau for helping with the recursive watching. My
brain officially didn't want to look at that code anymore.
This commit is contained in:
James Shubin
2016-09-09 02:09:37 -04:00
parent 4bd53d5ab0
commit 598c74657c
6 changed files with 663 additions and 173 deletions

View File

@@ -152,25 +152,6 @@ func TestMiscT4(t *testing.T) {
}
}
func TestMiscT5(t *testing.T) {
if PathIsDir("/foo/bar/baz/") != true {
t.Errorf("Result should be false.")
}
if PathIsDir("/foo/bar/baz") != false {
t.Errorf("Result should be false.")
}
if PathIsDir("/foo/") != true {
t.Errorf("Result should be true.")
}
if PathIsDir("/") != true {
t.Errorf("Result should be true.")
}
}
func TestMiscT8(t *testing.T) {
r0 := []string{"/"}