Cleanup
This commit is contained in:
parent
b328e58e6f
commit
903bc4a145
15
mount.go
15
mount.go
@ -2,22 +2,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"bazil.org/fuse"
|
||||
"bazil.org/fuse/fs"
|
||||
_ "bazil.org/fuse/fs/fstestutil"
|
||||
// "flag"
|
||||
// "fmt"
|
||||
"golang.org/x/net/context"
|
||||
"os"
|
||||
)
|
||||
|
||||
var Usage = func() {
|
||||
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
|
||||
fmt.Fprintf(os.Stderr, " %s MOUNTPOINT\n", os.Args[0])
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
// func main() {
|
||||
// flag.Usage = Usage
|
||||
// flag.Parse()
|
||||
@ -68,6 +60,7 @@ func (Dir) Attr(a *fuse.Attr) {
|
||||
}
|
||||
|
||||
func (Dir) Lookup(ctx context.Context, name string) (fs.Node, error) {
|
||||
|
||||
if name == "hello" {
|
||||
return File{}, nil
|
||||
}
|
||||
|
12
version.go
12
version.go
@ -60,12 +60,16 @@ func newVersion(base string, parent *version) (*version, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
version := &version{
|
||||
ver := &version{
|
||||
base: base,
|
||||
parent: parent,
|
||||
timestamp: time.Unix(timeval, 0)}
|
||||
|
||||
return version, nil
|
||||
if err := ver.loadMetadata(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ver, nil
|
||||
}
|
||||
|
||||
func (this *version) loadMetadata() error {
|
||||
@ -98,3 +102,7 @@ func (this *version) saveMetadata() error {
|
||||
func (this *version) metadataPath() string {
|
||||
return filepath.Join(this.base, "meta.json")
|
||||
}
|
||||
|
||||
func (this *version) rootPath() string {
|
||||
return filepath.Join(this.base, "root")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user