func Mount(dir string, ssn rh.Session, qmax int) (rh *RH, err error) {

	// Try connecting to FUSE twice. The first attempt, if failed, has the effect of
	// unmounting orphan mounted directories.
	var conn *fuse.Conn
	for i := 0; i < 2; i++ {
		if conn, err = fuse.Mount(dir); err == nil {
			break
		}
	}
	if err != nil {
		return nil, err
	}

	//
	rh = &RH{
		qmax: qmax,
		ssn:  ssn,
		conn: conn,
	}
	rh.eof.Init()
	rh.fuseEOF.Init()
	rh.node.Init()
	rh.serving.Init()
	rh.handle.Init()

	go func() { // Try to unmount the local mount directory when this process dies.
		ch := make(chan os.Signal, 1)
		signal.Notify(ch, os.Kill, os.Interrupt, syscall.SIGSTOP, syscall.SIGPIPE, syscall.SIGHUP, syscall.SIGFPE, syscall.SIGSEGV)
		<-ch
		fuse.Umount(dir)
	}()

	go rh.loop() // Start accepting FUSE requests

	return rh, nil
}
// Mount mounts the file system of the resource hierarchy ssn onto the local directory dir.
Mount mounts the file system of the resource hierarchy ssn onto the local directory dir.
// Mount mounts the file system of the resource hierarchy ssn onto the local directory dir .
func Mount(dir string, ssn rh.Session, qmax int) (rh *RH, err error) {
	var conn *fuse.Conn
	for i := 0; i < 2; i++ {
		if conn, err = fuse.Mount(dir); err == nil {
			break
		}
	}
	if err != nil {
		return nil, err
	}
	rh = &RH{
		qmax: qmax,
		ssn:  ssn,
		conn: conn,
	}
	rh.eof.Init()
	rh.fuseEOF.Init()
	rh.node.Init()
	rh.serving.Init()
	rh.handle.Init()
	go func() {  Try to unmount the local mount directory when this process dies.
		ch := make(chan os.Signal, 1)
		signal.Notify(ch, os.Kill, os.Interrupt, syscall.SIGSTOP, syscall.SIGPIPE, syscall.SIGHUP, syscall.SIGFPE, syscall.SIGSEGV)
		<-ch
		fuse.Umount(dir)
	}()
	go rh.loop()  Start accepting FUSE requests
	return rh, nil
}
func Mount ( dir string , ssn rh . Session , qmax int ) ( rh * RH , err error ) { var conn * fuse . Conn for i := 0 ; i < 2 ; i ++ { if conn , err = fuse . Mount ( dir ) ; err == nil { break } } if err != nil { return nil , err } rh = & RH { qmax : qmax , ssn : ssn , conn : conn , } rh . eof . Init ( ) rh . fuseEOF . Init ( ) rh . node . Init ( ) rh . serving . Init ( ) rh . handle . Init ( ) go func ( ) { ch := make ( chan os . Signal , 1 ) signal . Notify ( ch , os . Kill , os . Interrupt , syscall . SIGSTOP , syscall . SIGPIPE , syscall . SIGHUP , syscall . SIGFPE , syscall . SIGSEGV ) <- ch fuse . Umount ( dir ) } ( ) go rh . loop ( ) return rh , nil }
Mount mounts the file system of the resource hierarchy ssn onto the local directory dir.
Mount mounts the file system of the resource hierarchy ssn onto the local directory dir .
// Try connecting to FUSE twice. The first attempt, if failed, has the effect of // unmounting orphan mounted directories. // // Try to unmount the local mount directory when this process dies. // Start accepting FUSE requests