-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
57 lines (47 loc) · 880 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* TACIXAT 2020 */
package main
import (
"bazil.org/fuse"
"bazil.org/fuse/fs"
"flag"
"fmt"
"log"
"math/rand"
"os"
)
var seed *int64
var mountPoint *string
var batchSize *uint
func init() {
seed = flag.Int64("s", 0, "rand seed")
mountPoint = flag.String("mp", "", "/mnt/point")
batchSize = flag.Uint("bs", 10, "mutate batch size")
}
func usage() {
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s -mp /some/mount/point\n", os.Args[0])
flag.PrintDefaults()
}
func main() {
flag.Usage = usage
flag.Parse()
rand.Seed(*seed)
if len(*mountPoint) == 0 {
usage()
os.Exit(2)
}
c, err := fuse.Mount(
*mountPoint,
fuse.FSName("FuzzyFileSystem"),
fuse.Subtype("ffs"),
)
if err != nil {
log.Fatal(err)
}
defer c.Close()
fmt.Println("Serving...")
err = fs.Serve(c, NewFFS())
if err != nil {
log.Fatal(err)
}
}