<commit_before>package HotPotatoFS

import (
	"bazil.org/fuse"
	"bazil.org/fuse/fs"
	"github.com/golang/groupcache"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"syscall"
)

var filecache *groupcache.Group

func ServeDir(mountpoint string, target string, peerlist []string) {
	// me := "http://localhost"
	// peers := groupcache.NewHTTPPool(me)

	// Whenever peers change:
	//peers.Set("http://10.0.0.1", "http://10.0.0.2", "http://10.0.0.3")

	//fuse.Debugf = log.Printf

	filecache = groupcache.NewGroup("filecache", 64<<20, groupcache.GetterFunc(
		func(ctx groupcache.Context, key string, dest groupcache.Sink) error {
			contents, err := ioutil.ReadFile(key)
			dest.SetBytes(contents)
			return err
		}))

	c, err := fuse.Mount(mountpoint)
	if err != nil {
		log.Fatal(err)
	}

	fs.Serve(c, TargetDir{target})

}

type TargetDir struct {
	Path string
}
<commit_msg>still not workign on os x<commit_after>package HotPotatoFS

import (
	"bazil.org/fuse"
	"bazil.org/fuse/fs"
	"github.com/golang/groupcache"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"syscall"
)

var filecache *groupcache.Group

func ServeDir(mountpoint string, target string, peerlist []string) {
	// me := "http://localhost"
	// peers := groupcache.NewHTTPPool(me)

	// Whenever peers change:
	//peers.Set("http://10.0.0.1", "http://10.0.0.2", "http://10.0.0.3")

	fuse.Debugf = log.Printf

	filecache = groupcache.NewGroup("filecache", 64<<20, groupcache.GetterFunc(
		func(ctx groupcache.Context, key string, dest groupcache.Sink) error {
			contents, err := ioutil.ReadFile(key)
			dest.SetBytes(contents)
			return err
		}))

	c, err := fuse.Mount(mountpoint)
	if err != nil {
		log.Fatal(err)
	}

	fs.Serve(c, TargetDir{target})

}

type TargetDir struct {
	Path string
}

{'fraction_non_alphanumeric': 0.16685714285714287, 'fraction_numerical': 0.021714285714285714, 'mean_word_length': 3.8370165745856353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5722875', 'n_tokens_mistral': 741, 'n_tokens_neox': 689, 'n_words': 133}