Commit 90b2a0f3 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Use reflection to provide sensible default name.

parent c057d5f1
......@@ -5,6 +5,7 @@ package fuse
import (
"bytes"
"log"
"reflect"
"time"
"github.com/hanwen/go-fuse/raw"
......@@ -16,7 +17,13 @@ func (c *FileSystemConnector) String() string {
if c.rootNode == nil || c.rootNode.mount == nil {
return "go-fuse:unmounted"
}
return c.rootNode.mount.fs.String()
fs := c.rootNode.mount.fs
name := fs.String()
if name == "DefaultNodeFileSystem" {
name = reflect.TypeOf(fs).Name()
}
return name
}
func (c *FileSystemConnector) Init(fsInit *RawFsInit) {
......
package fuse
import (
"fmt"
"log"
"path/filepath"
"reflect"
"sync"
)
......@@ -88,7 +88,11 @@ func (fs *PathNodeFs) OnUnmount() {
}
func (fs *PathNodeFs) String() string {
return fmt.Sprintf("PathNodeFs(%v)", fs.fs)
name := fs.fs.String()
if name == "DefaultFileSystem" {
name = reflect.TypeOf(fs.fs).Name()
}
return name
}
func (fs *PathNodeFs) OnMount(conn *FileSystemConnector) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment