// Close unmounts the filesystem and waits for fs.Serve to return. Any // returned error will be stored in Err. It is safe to call Close // multiple times. func (mnt *Mount) Close() { if mnt.closed { return } mnt.closed = true for tries := 0; tries < 1000; tries++ { err := fuse.Unmount(mnt.Dir) if err != nil { // TODO do more than log? log.Printf("unmount error: %v", err) time.Sleep(10 * time.Millisecond) continue } break } <-mnt.done mnt.Conn.Close() os.Remove(mnt.Dir) }
// Attempt to unmount the file system whose mount point is the supplied // directory. func Unmount(dir string) error { return bazilfuse.Unmount(dir) }